Skip to content

Commit 998efb9

Browse files
committed
Fix isCoi bug
1 parent 49ed095 commit 998efb9

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/flow/flow.service.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -596,14 +596,16 @@ export class FlowService {
596596
ranking.map(async (el) => ({
597597
...el,
598598
stars: await this.getProjectStars(el.projectId, userId),
599-
coi: await this.isCoi(el.projectId, userId),
599+
coi: await this.isCoi(userId, el.projectId),
600600
})),
601601
);
602602

603603
return withMoreFields.sort((a, b) => b.share - a.share);
604604
};
605605

606606
undo = async (userId: number, parentCollection: number | null) => {
607+
// TODO: Check if a colleciton is still wip and not finished
608+
607609
const lastVote = await this.prismaService.vote.findFirst({
608610
where: {
609611
userId,
@@ -783,6 +785,7 @@ export class FlowService {
783785
projectStars,
784786
allProjects,
785787
);
788+
// console.log('real progress:', realProgress);
786789

787790
const progress = Math.min(1, realProgress * 3);
788791

@@ -833,7 +836,7 @@ export class FlowService {
833836
new Set(allProjects.map((item) => item.implicitCategory)),
834837
).map((cat, index) => ({ name: cat, priority: index * 2 }));
835838

836-
console.log(shuffleArraySeeded(implicitCategoryPriorities, userId));
839+
// console.log(shuffleArraySeeded(implicitCategoryPriorities, userId));
837840

838841
const getImplicitCatScore = (cat: string) =>
839842
shuffleArraySeeded(implicitCategoryPriorities, userId).find(

0 commit comments

Comments
 (0)