From 0fa945163338a271039a5e46fb3547c6a547e5c6 Mon Sep 17 00:00:00 2001 From: guru_sainath Date: Tue, 2 May 2023 18:15:24 +0530 Subject: [PATCH] fix: workspace integration github repos issue resolved (#988) --- .../app/components/integration/github/select-repository.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/apps/app/components/integration/github/select-repository.tsx b/apps/app/components/integration/github/select-repository.tsx index a925eced4..b1781b70e 100644 --- a/apps/app/components/integration/github/select-repository.tsx +++ b/apps/app/components/integration/github/select-repository.tsx @@ -11,7 +11,7 @@ import { CustomSearchSelect } from "components/ui"; // helpers import { truncateText } from "helpers/string.helper"; // types -import { IWorkspaceIntegration } from "types"; +import { IWorkspaceIntegration, IGithubRepository } from "types"; type Props = { integration: IWorkspaceIntegration; @@ -54,7 +54,9 @@ export const SelectRepository: React.FC = ({ isValidating, } = useSWRInfinite(getKey, fetchGithubRepos); - const userRepositories = (paginatedData ?? []).map((data) => data.repositories).flat(); + let userRepositories = (paginatedData ?? []).map((data) => data.repositories).flat(); + userRepositories = userRepositories.filter((data) => data?.id); + const totalCount = paginatedData && paginatedData.length > 0 ? paginatedData[0].total_count : 0; const options =