diff --git a/apps/code/src/renderer/api/posthogClient.ts b/apps/code/src/renderer/api/posthogClient.ts index 0114942534..5f24d28303 100644 --- a/apps/code/src/renderer/api/posthogClient.ts +++ b/apps/code/src/renderer/api/posthogClient.ts @@ -1473,15 +1473,18 @@ export class PostHogAPIClient { } } - async getIntegrations() { + async getIntegrations(kind?: string) { const teamId = await this.getTeamId(); - return this.getIntegrationsForProject(teamId); + return this.getIntegrationsForProject(teamId, kind); } - async getIntegrationsForProject(projectId: number) { + async getIntegrationsForProject(projectId: number, kind?: string) { const url = new URL( `${this.api.baseUrl}/api/environments/${projectId}/integrations/`, ); + if (kind) { + url.searchParams.set("kind", kind); + } const response = await this.api.fetcher.fetch({ method: "get", url, diff --git a/apps/code/src/renderer/features/onboarding/hooks/usePrefetchSignalData.ts b/apps/code/src/renderer/features/onboarding/hooks/usePrefetchSignalData.ts index 5f65d593a9..84c7f11abc 100644 --- a/apps/code/src/renderer/features/onboarding/hooks/usePrefetchSignalData.ts +++ b/apps/code/src/renderer/features/onboarding/hooks/usePrefetchSignalData.ts @@ -36,7 +36,7 @@ export function usePrefetchSignalData(): void { queryClient.prefetchQuery({ queryKey: ["integrations", "list"], queryFn: async () => { - const integrations = await client.getIntegrations(); + const integrations = await client.getIntegrations("github"); const ghIntegration = ( integrations as { id: number; kind: string }[] ).find((i) => i.kind === "github"); diff --git a/apps/code/src/renderer/hooks/useIntegrations.ts b/apps/code/src/renderer/hooks/useIntegrations.ts index b32cd2c63f..4c07c38b44 100644 --- a/apps/code/src/renderer/hooks/useIntegrations.ts +++ b/apps/code/src/renderer/hooks/useIntegrations.ts @@ -71,7 +71,7 @@ export function useIntegrations() { const query = useAuthenticatedQuery( integrationKeys.list(), - (client) => client.getIntegrations() as Promise, + (client) => client.getIntegrations("github") as Promise, ); useEffect(() => {