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

View file

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