From c4eab11bbb5a89b6128577641f34c17cac4df1b6 Mon Sep 17 00:00:00 2001 From: Aydan Pirani Date: Sat, 6 Jul 2024 23:36:46 -0700 Subject: [PATCH] removed the return type annotations --- src/services/checkin/checkin-utils.ts | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/services/checkin/checkin-utils.ts b/src/services/checkin/checkin-utils.ts index 0762535..ae86a27 100644 --- a/src/services/checkin/checkin-utils.ts +++ b/src/services/checkin/checkin-utils.ts @@ -9,10 +9,7 @@ function getCurrentDay() { return dayString; } -async function checkEventAndAttendeeExist( - eventId: string, - userId: string -): Promise { +async function checkEventAndAttendeeExist(eventId: string, userId: string) { const [event, attendee] = await Promise.all([ Database.EVENTS.exists({ eventId }), Database.ATTENDEE.exists({ userId }), @@ -25,10 +22,7 @@ async function checkEventAndAttendeeExist( return Promise.resolve(); } -async function checkForDuplicateAttendance( - eventId: string, - userId: string -): Promise { +async function checkForDuplicateAttendance(eventId: string, userId: string) { const [isRepeatEvent, isRepeatAttendee] = await Promise.all([ Database.EVENTS_ATTENDANCE.exists({ eventId, attendees: userId }), Database.ATTENDEE_ATTENDANCE.exists({ @@ -43,7 +37,7 @@ async function checkForDuplicateAttendance( } // Update attendee priority for the current day -async function updateAttendeePriority(userId: string): Promise { +async function updateAttendeePriority(userId: string) { const day = getCurrentDay(); await Database.ATTENDEE.findOneAndUpdate( { userId }, @@ -51,10 +45,7 @@ async function updateAttendeePriority(userId: string): Promise { ); } -async function updateAttendanceRecords( - eventId: string, - userId: string -): Promise { +async function updateAttendanceRecords(eventId: string, userId: string) { await Promise.all([ Database.EVENTS_ATTENDANCE.findOneAndUpdate( { eventId }, @@ -73,7 +64,7 @@ export async function checkInUserToEvent( eventId: string, userId: string, isCheckin: boolean = false -): Promise { +) { try { await checkEventAndAttendeeExist(eventId, userId); await checkForDuplicateAttendance(eventId, userId);