Skip to content

Commit

Permalink
fix: use updated_at instead of marked_at for projects
Browse files Browse the repository at this point in the history
  • Loading branch information
FreekBes committed Jan 28, 2025
1 parent f1aa109 commit a195100
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/routes/hooks/projects_users.ts
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ export const handleProjectsUserUpdateWebhook = async function(prisma: PrismaClie
console.warn("No user ID found in the projectUser data, skipping score creation...", projectUser);
return (res ? respondWebHookHandledStatus(prisma, webhookDeliveryId, res, WebhookHandledStatus.Skipped) : null);
}
const markedAt = new Date(projectUser.marked_at);
const updatedAt = new Date(projectUser.updated_at); // Could use markedAt, but the updated_at is more reliable (marked_at can be months ago if the evaluation feedback was filled in months after the project was marked)
const score = await handleFixedPointScore(prisma, fixedPointType, projectUser.id, userId, points,
`Validated ${project.name} with ${projectUser.final_mark}%`, markedAt);
`Validated ${project.name} with ${projectUser.final_mark}%`, updatedAt);
if (!score) {
console.warn("Refused or failed to create score, skipping...");
return (res ? respondWebHookHandledStatus(prisma, webhookDeliveryId, res, WebhookHandledStatus.Skipped) : null);
Expand Down

0 comments on commit a195100

Please sign in to comment.