-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Feature Admin update role 187584923 #36
Conversation
Please resolve the conflicts |
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
src/routes/userRouter.ts
Outdated
const router: Router = Router() | ||
|
||
router.put("/admin-update-user-status/:id", validation(statusSchema), isUserExist, userControllers.updateUserStatus); | ||
router.put("/admin-update-role/:id",validation(updateUserRoleSchema),validateUpdateUserRole, userControllers.updateUserRole); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What the use this middleware validateUpdateUserRole
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
At first i was using it checking if the user exists but i removed it, as there is the one made for that.
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
…-rwanda/e-commerce-ninjas-bn into admin-update-role-187584923
Finished to allow the admin to change the role of any User,
The roles are ['Admin','Seller','Buyer'] only.
The remainig task on this feature is to protect the route. and checking if the acting user is Admin truly.