Skip to content

Commit

Permalink
Merge pull request #7620 from RocketChat/fix-set-avatar-username
Browse files Browse the repository at this point in the history
[FIX] The username not being allowed to be passed into the user.setAvatar
  • Loading branch information
rodrigok authored Aug 1, 2017
2 parents 02fa343 + 548f3cd commit 6f4d5c5
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/rocketchat-api/server/v1/users.js
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,11 @@ RocketChat.API.v1.addRoute('users.resetAvatar', { authRequired: true }, {

RocketChat.API.v1.addRoute('users.setAvatar', { authRequired: true }, {
post() {
check(this.bodyParams, { avatarUrl: Match.Maybe(String), userId: Match.Maybe(String) });
check(this.bodyParams, Match.ObjectIncluding({
avatarUrl: Match.Maybe(String),
userId: Match.Maybe(String),
username: Match.Maybe(String)
}));

let user;
if (this.isUserFromParams()) {
Expand Down

0 comments on commit 6f4d5c5

Please sign in to comment.