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
@@ -22,7 +22,7 @@ export default async function getCurrent(req: NextApiRequest, res: NextApiRespon
selectedUserPhoneNumber, } = 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.`
);
+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.`
);
+4 -1
View File
@@ -10,8 +10,11 @@ export default async function updtateGift(req: NextApiRequest, res: NextApiRespo
const session = await getSession({ req })
const { gain } = req.body;
console.log(req.method);
// 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.`
);