-
Notifications
You must be signed in to change notification settings - Fork 5
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
#166790110: Super admin should be able to create users #46
Conversation
ce51e80
to
5d440fc
Compare
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.
Admin is user the only difference is that he/she can access any other user and perform operations on them as if he/she is the other logged in user.
Kindly implement the reviews.
5d440fc
to
1686f27
Compare
1686f27
to
dad9ce7
Compare
0ba1ec9
to
f1f0ade
Compare
f1f0ade
to
dacd2f9
Compare
dacd2f9
to
98cca19
Compare
- Added test for the admin fationality. - Added routers for the admin factionality, - Added swagger documentation for admin fanctionality.
98cca19
to
256b490
Compare
|
||
router.delete('/api/users/:id', verifyToken, checkAction('User'), UserController.deleteUser); |
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.
Why are you having this action checkAction('User')
here and not at the controller level?
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.
checkAction
is a middleware function that checks if a user trying to access the router has the priority of deleting in a user table.
@@ -31,20 +32,32 @@ class UserProfile { | |||
* @return {object} returns an object containing the updated user profile | |||
*/ | |||
static async updateProfile(req, res) { |
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.
This should be refactored better during code maintainability session
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.
Implement review that relates to routing
What does this PR do?
Description of Task to be completed?
How should this be manually tested?
By using postman:
By using swagger documentation.
-By running test: npm run test.
Any background context you want to provide?
What are the relevant pivotal tracker stories?
#166790110
Screenshots
Questions: