1.40K viewsMern Amazona

Answer:

you need to move /profile function above /:id function in userRoutes.js

Bassir Answered question October 13, 2022

you need to move /profile function above /:id function in userRoutes.js. I mean move:

[apcode language=”jscript”]userRouter.put("/profile",isAuth,

...[/apcode]

above

[apcode language=”jscript”]

userRouter.put( “/:id”,isAuth,isAdmin,

...[/apcode]

like this:

https://github.com/basir/mern-amazona/blob/master/backend/routes/userRoutes.js#L33

Bassir Edited answer October 30, 2022
You are viewing 1 out of 1 answers, click here to view all answers.