Correct HTTP response. Fixes #2134

This commit is contained in:
Mike Cao 2023-07-31 23:08:28 -07:00
parent 2b06c4b4d1
commit 64ebe8b307

View File

@ -1,5 +1,5 @@
import { NextApiResponse } from 'next';
import { methodNotAllowed, ok, unauthorized } from 'next-basics';
import { badRequest, methodNotAllowed, ok, unauthorized } from 'next-basics';
import { WebsiteMetric, NextApiRequestQueryBody } from 'lib/types';
import { canViewWebsite } from 'lib/auth';
import { useAuth, useCors } from 'lib/middleware';
@ -121,6 +121,8 @@ export default async (
return ok(res, data);
}
return badRequest(res);
}
return methodNotAllowed(res);