From abd6ac7a8dcd034c6db0419d65747dcd283e0c34 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Thu, 26 Jan 2023 15:42:12 +0100 Subject: [PATCH] well, need to wait until mail is send or function is terminated --- pages/api/bookings/[uuid]/index.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pages/api/bookings/[uuid]/index.ts b/pages/api/bookings/[uuid]/index.ts index c86ceb2..d5e4da9 100644 --- a/pages/api/bookings/[uuid]/index.ts +++ b/pages/api/bookings/[uuid]/index.ts @@ -65,11 +65,11 @@ export default async function userHandler( // TODO: this should really go into the schema try { if (wasRejected(previous, current)) { - sendBookingRejected(current) + await sendBookingRejected(current) } else if (wasConfirmed(previous, current)) { - sendBookingConfirmed(current) + await sendBookingConfirmed(current) } else if (wasCanceled(previous, current)) { - sendBookingCanceled(current) + await sendBookingCanceled(current) } } catch (error) { log.error(`Failed to send booking ${current} for booking ${uuid}`)