fix: workspace integration github repos issue resolved (#988)

This commit is contained in:
guru_sainath 2023-05-02 18:15:24 +05:30 committed by GitHub
parent 20e400487f
commit 0fa9451633
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -11,7 +11,7 @@ import { CustomSearchSelect } from "components/ui";
// helpers // helpers
import { truncateText } from "helpers/string.helper"; import { truncateText } from "helpers/string.helper";
// types // types
import { IWorkspaceIntegration } from "types"; import { IWorkspaceIntegration, IGithubRepository } from "types";
type Props = { type Props = {
integration: IWorkspaceIntegration; integration: IWorkspaceIntegration;
@ -54,7 +54,9 @@ export const SelectRepository: React.FC<Props> = ({
isValidating, isValidating,
} = useSWRInfinite(getKey, fetchGithubRepos); } = 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 totalCount = paginatedData && paginatedData.length > 0 ? paginatedData[0].total_count : 0;
const options = const options =