From a7ea2027853be35254039df07422d9e89fa0607c Mon Sep 17 00:00:00 2001 From: Mike Cao Date: Wed, 30 Aug 2023 16:33:06 -0700 Subject: [PATCH] Check for payload. --- src/pages/api/send.ts | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/pages/api/send.ts b/src/pages/api/send.ts index a379f261..56a748e1 100644 --- a/src/pages/api/send.ts +++ b/src/pages/api/send.ts @@ -79,6 +79,10 @@ export default async (req: NextApiRequestCollect, res: NextApiResponse) => { const { type, payload } = getJsonBody(req); + if (!type || !payload) { + return badRequest(res); + } + req.yup = schema; await useValidate(req, res);