Skip to content

Commit

Permalink
refactor: ♻️ correct var names
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinWu098 committed Apr 30, 2024
1 parent 57124bb commit 04738f4
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/routes/availability/[slug]/+page.server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ async function saveAvailabilities({ request, locals }: { request: Request; local
}

export async function _getMeeting(meetingId: string): Promise<MeetingSelectSchema> {
const [testMeeting] = await db.select().from(meetings).where(eq(meetings.id, meetingId));
const [meeting] = await db.select().from(meetings).where(eq(meetings.id, meetingId));

return testMeeting;
return meeting;
}

async function getMeetingDates(meetingId: string): Promise<MeetingDateSelectSchema[]> {
const testMeeting = await _getMeeting(meetingId);
const testMeetingDates = await db
const dbMeeting = await _getMeeting(meetingId);
const dbMeetingDates = await db
.select()
.from(meetingDates)
.where(eq(meetingDates.meeting_id, testMeeting.id));
.where(eq(meetingDates.meeting_id, dbMeeting.id));

return testMeetingDates.sort((a, b) => (a.date < b.date ? -1 : 1));
return dbMeetingDates.sort((a, b) => (a.date < b.date ? -1 : 1));
}

0 comments on commit 04738f4

Please sign in to comment.