Skip to content

Update users API#46

Open
SuJiaKuan wants to merge 3 commits intoweitingchou:masterfrom
SuJiaKuan:update-users
Open

Update users API#46
SuJiaKuan wants to merge 3 commits intoweitingchou:masterfrom
SuJiaKuan:update-users

Conversation

@SuJiaKuan
Copy link
Copy Markdown
Collaborator

  • Update /user/:id/password (PATCH) by adding oldPassword field in request body
  • Add /user/:id/role (PATCH) to update user's role

Comment thread services/api/users.js
const roleValidator = checkSchema({
role: {
matches: {
errorMessage: `Role should be "${ROLES.WRITER}" or "${ROLES.READER}"`,
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can only add writer and reader except for admin?

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.

2 participants