diff --git a/components/dashboard/src/data/git-providers/unified-repositories-search-query.ts b/components/dashboard/src/data/git-providers/unified-repositories-search-query.ts index 86fe1386cc10e7..b2ae500f7369eb 100644 --- a/components/dashboard/src/data/git-providers/unified-repositories-search-query.ts +++ b/components/dashboard/src/data/git-providers/unified-repositories-search-query.ts @@ -15,12 +15,16 @@ export const useUnifiedRepositorySearch = ({ searchString }: { searchString: str const searchQuery = useSearchRepositories({ searchString }); const filteredRepos = useMemo(() => { - const repoMap = new Map((suggestedQuery.data || []).map((r) => [r.url, r])); + const repoMap = new Map( + (suggestedQuery.data || []).map((r) => [`${r.url}:${r.projectId || ""}`, r]), + ); // Merge the search results into the suggested results for (const repo of searchQuery.data || []) { - if (!repoMap.has(repo.url)) { - repoMap.set(repo.url, repo); + const key = `${repo.url}:${repo.projectId || ""}`; + + if (!repoMap.has(key)) { + repoMap.set(key, repo); } }