Skip to content

Commit

Permalink
Fixed checkin event issue
Browse files Browse the repository at this point in the history
  • Loading branch information
Aydan Pirani committed Sep 18, 2024
1 parent 0b905e8 commit 3908605
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/services/checkin/checkin-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,13 @@ async function assignPixelsToUser(userId: string, pixels: number) {
);
}

export async function markUserAsCheckedIn(userId: string) {
await Database.ATTENDEE.findOneAndUpdate(
{ userId },
{ hasCheckedIn: true }
);
}

export async function checkInUserToEvent(
eventId: string,
userId: string,
Expand All @@ -91,7 +98,9 @@ export async function checkInUserToEvent(
await checkEventAndAttendeeExist(eventId, userId);
await checkForDuplicateAttendance(eventId, userId);

if (!isCheckin) {
if (isCheckin) {
await markUserAsCheckedIn(userId);
} else {
await updateAttendeePriority(userId);
}

Expand Down

0 comments on commit 3908605

Please sign in to comment.