From 4431142d4e540b8d0135241cff16d0c7d3fbff61 Mon Sep 17 00:00:00 2001 From: Syed Ali Shahbaz Date: Fri, 10 Jun 2022 12:58:04 +0530 Subject: [PATCH] remove unnecessary return --- pages/api/bookings/index.ts | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pages/api/bookings/index.ts b/pages/api/bookings/index.ts index 73c4e8d12b..322543078f 100644 --- a/pages/api/bookings/index.ts +++ b/pages/api/bookings/index.ts @@ -93,10 +93,9 @@ async function createOrlistAllBookings( const eventType = await prisma.eventType .findUnique({ where: { id: booking.eventTypeId as number } }) .then((data) => schemaEventTypeReadPublic.parse(data)) - .then((event_type) => res.status(200).json({ event_type })) .catch((error: Error) => res.status(404).json({ - message: `EventType with id: ${booking?.eventTypeId} not found`, + message: `EventType with id: ${booking.eventTypeId} not found`, error, }) );