Hotfix/schedule (#174)
* Allows empty call An authorized API call by a non-admin user with empty body will still fetch his data now * Adds missing return
This commit is contained in:
@@ -16,6 +16,7 @@ export async function scheduleById(
|
||||
body = safeParseJSON(body);
|
||||
if (!body.success) {
|
||||
res.status(400).json({ message: body.message });
|
||||
return;
|
||||
}
|
||||
|
||||
const safeBody = schemaSingleScheduleBodyParams.safeParse(body);
|
||||
|
||||
@@ -16,7 +16,7 @@ async function createOrlistAllSchedules(
|
||||
res: NextApiResponse<SchedulesResponse | ScheduleResponse>
|
||||
) {
|
||||
body = safeParseJSON(body);
|
||||
if (!body.success) {
|
||||
if (body.success !== undefined && !body.success) {
|
||||
res.status(400).json({ message: body.message });
|
||||
return;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user