Skip to content

Commit

Permalink
quick contribution fix
Browse files Browse the repository at this point in the history
  • Loading branch information
3vorp committed Feb 23, 2024
1 parent 883605b commit 380759a
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/v2/repository/contributions.repository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,15 @@ export default class ContributionFirestormRepository implements ContributionsRep
getAuthors(): Promise<ContributionsAuthors> {
const out = {};

// don't use values because we need duplicates
return (
contributions
.values({ field: "authors", flatten: true })
.select({ fields: ["authors"] })
.then((res) =>
Object.values(res)
.map((o) => o.authors)
.flat(),
)
.then((authors) =>
authors.forEach((id) => {
if (!out[id]) out[id] = { id, contributions: 1 };
Expand Down

0 comments on commit 380759a

Please sign in to comment.