This commit is contained in:
eric committed 2022-12-11 19:00:47 +01:00
1 parent 9e70d7b16f
commit 1b3f5328b0
5 files changed
+15 -8

No files matched your search

+1 -1
View File
@@ -7,7 +7,7 @@ export default async function updateOrCreate(req: NextApiRequest, res: NextApiRe
const { address, name, phoneNumber, surname, zipCode } = req.body;
// est-ce la méthode est un POST ou PUT?
if (req.method !== ("POST" || "PUT")) {
if (!(['POST', 'PUT'].indexOf(req.method) > -1)) {
throw new Error(
`The HTTP ${req.method} method is not supported at this route.`
);