return empty array if no bookings available (#14159)

Co-authored-by: CarinaWolli <[email protected]>
Co-authored-by: Udit Takkar <[email protected]>
This commit is contained in:
authored and GitHub committed 2024-03-22 12:56:06 +00:00
1 parent 896ba104fd
commit eb580e91de
1 file changed
+1 -4
@@ -26,10 +26,7 @@ async function handler(req: NextApiRequest, res: NextApiResponse) {
? authorizedAccount.name
: null;
const requested = teamInfo ? `team: ${teamInfo}` : `user: ${userInfo}`;
return res.status(404).json({
message: `There are no bookings to retrieve, please create a booking first. Requested: \`${requested}\``,
});
return res.status(201).json([]);
}
res.status(201).json(bookings);
}