From 4b313d2df301500d76b1f64e0e0b586102e70790 Mon Sep 17 00:00:00 2001 From: Thomas Ruoff Date: Tue, 11 Oct 2022 12:02:06 +0200 Subject: [PATCH] fix serialization error --- lib/getServerSideProps.ts | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/getServerSideProps.ts b/lib/getServerSideProps.ts index f3a3203..63bc65c 100644 --- a/lib/getServerSideProps.ts +++ b/lib/getServerSideProps.ts @@ -38,6 +38,8 @@ export const getServerSideBooking = async ( const uuid = Array.isArray(uuids) ? uuids[0] : uuids const booking = await getBookingByUUID(uuid) + console.log(booking.createdAt); + if (!booking) { res.statusCode = 404 res.end() @@ -45,6 +47,10 @@ export const getServerSideBooking = async ( } return { - props: { booking }, + props: { booking: { + ...booking, + createdAt: booking.createdAt.toISOString(), + updatedAt: booking.updatedAt.toISOString(), + }}, } }