Skip to content

Commit d451457

Browse files
authored
Coerce Date objects to strings for DynamoDB (#137)
1 parent 97f0a7f commit d451457

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/api/routes/roomRequests.ts

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -282,8 +282,11 @@ const roomRequestRoutes: FastifyPluginAsync = async (fastify, _options) => {
282282
}
283283
const body = {
284284
...request.body,
285-
eventStart: request.body.eventStart.toUTCString(),
286-
eventEnd: request.body.eventStart.toUTCString(),
285+
eventStart: request.body.eventStart.toISOString(),
286+
eventEnd: request.body.eventStart.toISOString(),
287+
...(request.body.recurrenceEndDate
288+
? { recurrenceEndDate: request.body.recurrenceEndDate.toISOString() }
289+
: {}),
287290
requestId,
288291
userId: request.username,
289292
"userId#requestId": `${request.username}#${requestId}`,

0 commit comments

Comments
 (0)