🚑 fix bug important

This commit is contained in:
eric committed 2022-12-11 18:58:11 +01:00
1 parent a1388c6962
commit 9e70d7b16f
2 files changed
+3 -7

No files matched your search

+2 -6
View File
@@ -5,14 +5,10 @@ import { Role } from '../../../enum/role.enum';
export default async function updateUser(req: NextApiRequest, res: NextApiResponse) {
const session = await getSession({ req })
const { selectedUserRole, selectedUserEmail, selectedUserName,
selectedUserSurname,
selectedUserAddress,
selectedUserZipCode,
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
@@ -12,7 +12,7 @@ export default async function updateUser(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.`
);