Skip to content

Commit

Permalink
removed the return type annotations
Browse files Browse the repository at this point in the history
  • Loading branch information
AydanPirani committed Jul 7, 2024
1 parent 0870a49 commit c4eab11
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions src/services/checkin/checkin-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@ function getCurrentDay() {
return dayString;
}

async function checkEventAndAttendeeExist(
eventId: string,
userId: string
): Promise<void> {
async function checkEventAndAttendeeExist(eventId: string, userId: string) {
const [event, attendee] = await Promise.all([
Database.EVENTS.exists({ eventId }),
Database.ATTENDEE.exists({ userId }),
Expand All @@ -25,10 +22,7 @@ async function checkEventAndAttendeeExist(
return Promise.resolve();
}

async function checkForDuplicateAttendance(
eventId: string,
userId: string
): Promise<void> {
async function checkForDuplicateAttendance(eventId: string, userId: string) {
const [isRepeatEvent, isRepeatAttendee] = await Promise.all([
Database.EVENTS_ATTENDANCE.exists({ eventId, attendees: userId }),
Database.ATTENDEE_ATTENDANCE.exists({
Expand All @@ -43,18 +37,15 @@ async function checkForDuplicateAttendance(
}

// Update attendee priority for the current day
async function updateAttendeePriority(userId: string): Promise<void> {
async function updateAttendeePriority(userId: string) {
const day = getCurrentDay();
await Database.ATTENDEE.findOneAndUpdate(
{ userId },
{ $set: { [`hasPriority.${day}`]: true } }
);
}

async function updateAttendanceRecords(
eventId: string,
userId: string
): Promise<void> {
async function updateAttendanceRecords(eventId: string, userId: string) {
await Promise.all([
Database.EVENTS_ATTENDANCE.findOneAndUpdate(
{ eventId },
Expand All @@ -73,7 +64,7 @@ export async function checkInUserToEvent(
eventId: string,
userId: string,
isCheckin: boolean = false
): Promise<void> {
) {
try {

Check failure on line 68 in src/services/checkin/checkin-utils.ts

View workflow job for this annotation

GitHub Actions / lint

Unnecessary try/catch wrapper
await checkEventAndAttendeeExist(eventId, userId);
await checkForDuplicateAttendance(eventId, userId);
Expand Down

0 comments on commit c4eab11

Please sign in to comment.