Skip to content

Commit 32f9841

Browse files
committed
fix: add missing if-statement condition for point differences
1 parent d7b0714 commit 32f9841

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Diff for: src/handlers/points.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ export const handleFixedPointScore = async function(prisma: PrismaClient, type:
145145
// Score(s) were already given for this type and typeIntraId in the past.
146146
// Calculate the point difference and hand out the difference as a new score.
147147
const pointDifference = Math.floor(Math.floor(points) - existingScores._sum.amount);
148-
if (pointDifference < -10 ) {
148+
if (pointDifference > -10 && pointDifference < 1) {
149149
console.log(`Score(s) already exist for type ${type.type} and typeIntraId ${typeIntraId}. Point difference is (close to) 0, no need to create a new score.`);
150150
return null; // No difference in points, no need to create a new score
151151
}

0 commit comments

Comments
 (0)