✨
This commit is contained in:
1 parent
9e70d7b16f
commit
1b3f5328b0
5 files changed
+15
-8
No files matched your search
@@ -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.`
|
||||
);
|
||||
|
||||
@@ -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.`
|
||||
);
|
||||
|
||||
@@ -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.`
|
||||
);
|
||||
|
||||
Reference in new issue
Block a user