Skip to content

Commit

Permalink
Fix isCoi bug
Browse files Browse the repository at this point in the history
  • Loading branch information
mmahdigh committed Nov 12, 2024
1 parent e4599ec commit 17f7847
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/flow/flow.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -596,14 +596,16 @@ export class FlowService {
ranking.map(async (el) => ({
...el,
stars: await this.getProjectStars(el.projectId, userId),
coi: await this.isCoi(el.projectId, userId),
coi: await this.isCoi(userId, el.projectId),
})),
);

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

undo = async (userId: number, parentCollection: number | null) => {
// TODO: Check if a colleciton is still wip and not finished

const lastVote = await this.prismaService.vote.findFirst({
where: {
userId,
Expand Down Expand Up @@ -783,6 +785,7 @@ export class FlowService {
projectStars,
allProjects,
);
// console.log('real progress:', realProgress);

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

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

console.log(shuffleArraySeeded(implicitCategoryPriorities, userId));
// console.log(shuffleArraySeeded(implicitCategoryPriorities, userId));

const getImplicitCatScore = (cat: string) =>
shuffleArraySeeded(implicitCategoryPriorities, userId).find(
Expand Down

0 comments on commit 17f7847

Please sign in to comment.