fix key team helpers key list

This commit is contained in:
Ishaan Jaff 2025-03-08 16:33:27 -08:00
parent 12867797cc
commit 887fb28c22
2 changed files with 5 additions and 8 deletions

View file

@ -27,7 +27,7 @@ export const fetchAllKeyAliases = async (accessToken: string | null): Promise<st
// Extract aliases from this page
const pageAliases = response.keys
.map(key => key.key_alias)
.map((key: any) => key.key_alias)
.filter(Boolean) as string[];
allAliases = [...allAliases, ...pageAliases];
@ -41,7 +41,7 @@ export const fetchAllKeyAliases = async (accessToken: string | null): Promise<st
}
// Remove duplicates
return [...new Set(allAliases)];
return Array.from(new Set(allAliases));
} catch (error) {
console.error("Error fetching all key aliases:", error);
return [];
@ -66,8 +66,7 @@ export const fetchAllTeams = async (accessToken: string | null, organizationId?:
const response = await teamListCall(
accessToken,
organizationId || null,
currentPage,
100 // larger page size to reduce number of requests
null,
);
// Add teams from this page
@ -104,8 +103,6 @@ export const fetchAllOrganizations = async (accessToken: string | null): Promise
while (hasMorePages) {
const response = await organizationListCall(
accessToken,
currentPage,
100 // larger page size to reduce number of requests
);
// Add organizations from this page

View file

@ -1,6 +1,6 @@
import { useEffect, useState } from "react";
import { KeyResponse } from "../key_team_helpers/key_list";
import { Team, Organization } from "../networking";
import { KeyResponse, Team } from "../key_team_helpers/key_list";
import { Organization } from "../networking";
export interface FilterState {
'Team ID': string;