Skip to content
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

Merged
merged 69 commits into from
May 30, 2024
Merged

Conversation

ndahimana154
Copy link
Member

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.

@key-joshua
Copy link
Collaborator

Please resolve the conflicts

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);
Copy link
Collaborator

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 ?

Copy link
Member Author

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.

@key-joshua key-joshua merged commit 7582873 into develop May 30, 2024
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants