We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 739fdeb commit 120f7bcCopy full SHA for 120f7bc
1 file changed
services/libs/data-access-layer/src/repositories/index.ts
@@ -1,3 +1,4 @@
1
+import { groupBy } from '@crowd/common'
2
import { Logger } from '@crowd/logging'
3
import { RedisCache, RedisClient } from '@crowd/redis'
4
@@ -591,12 +592,7 @@ export async function getReposGroupedByOrg(
591
592
integrationId: string,
593
): Promise<Record<string, IGithubRepoForIntegration[]>> {
594
const repos = await getReposForGithubIntegration(qx, integrationId)
- const grouped: Record<string, IGithubRepoForIntegration[]> = {}
595
- for (const repo of repos) {
596
- if (!grouped[repo.owner]) grouped[repo.owner] = []
597
- grouped[repo.owner].push(repo)
598
- }
599
- return grouped
+ return Object.fromEntries(groupBy(repos, (repo) => repo.owner))
600
}
601
602
/**
0 commit comments