return empty array if no bookings available (#14159)
Co-authored-by: CarinaWolli <wollencarina@gmail.com> Co-authored-by: Udit Takkar <53316345+Udit-takkar@users.noreply.github.com>
This commit is contained in:
co-authored by
CarinaWolli
Udit Takkar
parent
896ba104fd
commit
eb580e91de
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user