Skip to content

Commit

Permalink
Fix #7509, allow the username to be passed into the setAvatar
Browse files Browse the repository at this point in the history
  • Loading branch information
graywolf336 committed Jul 31, 2017
1 parent 02fa343 commit 548f3cd
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 548f3cd

Please sign in to comment.