Debug booking API

This commit is contained in:
Syed Ali Shahbaz authored and GitHub committed 2022-06-11 22:39:03 +05:30
1 parent 4ba0e7752d
commit 910a0f386a
1 file changed
+1
+1
View File
@@ -35,6 +35,7 @@ async function createOrlistAllBookings(
*/
const data = await prisma.booking.findMany({ where: { userId } });
const bookings = data.map((booking) => schemaBookingReadPublic.parse(booking));
console.log(`Bookings requested by ${userId}`);
if (bookings) res.status(200).json({ bookings });
else
(error: Error) =>