From bc775371e5fd6433315b549a11dba732acd79ed4 Mon Sep 17 00:00:00 2001 From: Kevin Wu Date: Mon, 6 May 2024 20:35:30 -0700 Subject: [PATCH] =?UTF-8?q?fix:=20=F0=9F=90=9B=20unasync=20map=20func?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/routes/availability/[slug]/+page.server.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/src/routes/availability/[slug]/+page.server.ts b/src/routes/availability/[slug]/+page.server.ts index 9a1e8a0d..4b416bb4 100644 --- a/src/routes/availability/[slug]/+page.server.ts +++ b/src/routes/availability/[slug]/+page.server.ts @@ -73,14 +73,12 @@ async function save({ request, locals }: { request: Request; locals: App.Locals user?.id ?? (await getExistingGuest(formData.get("username") as string, await _getMeeting(meetingId))).id; - const insertDates: AvailabilityInsertSchema[] = await Promise.all( - availabilityDates.map(async (date, index) => ({ - day: new Date(date.day).toISOString(), - member_id: memberId, - meeting_day: dbMeetingDates[index].id as string, // Type-cast since id is guaranteed if a meetingDate exists - availability_string: date.availability.toString(), - })), - ); + const insertDates: AvailabilityInsertSchema[] = availabilityDates.map((date, index) => ({ + day: new Date(date.day).toISOString(), + member_id: memberId, + meeting_day: dbMeetingDates[index].id as string, // Type-cast since id is guaranteed if a meetingDate exists + availability_string: date.availability.toString(), + })); await db.transaction(async (tx) => { await tx