Correct HTTP response. Fixes #2134
This commit is contained in:
1 parent
2b06c4b4d1
commit
64ebe8b307
1 file changed
+3
-1
@@ -1,5 +1,5 @@
|
|||||||
import { NextApiResponse } from 'next';
|
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 { WebsiteMetric, NextApiRequestQueryBody } from 'lib/types';
|
||||||
import { canViewWebsite } from 'lib/auth';
|
import { canViewWebsite } from 'lib/auth';
|
||||||
import { useAuth, useCors } from 'lib/middleware';
|
import { useAuth, useCors } from 'lib/middleware';
|
||||||
@@ -121,6 +121,8 @@ export default async (
|
|||||||
|
|
||||||
return ok(res, data);
|
return ok(res, data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
return badRequest(res);
|
||||||
}
|
}
|
||||||
|
|
||||||
return methodNotAllowed(res);
|
return methodNotAllowed(res);
|
||||||
|
|||||||
Reference in new issue
Block a user