Skip to content

Commit

Permalink
Fix displayName of current user after creation/update if user's displ…
Browse files Browse the repository at this point in the history
…ay name with diacritics
  • Loading branch information
AlexeySafronov committed Nov 13, 2021
1 parent d6836cc commit f06283b
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion packages/asc-web-common/api/people/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,12 @@ export function createUser(data, confirmKey = null) {

if (confirmKey) options.headers = { confirm: confirmKey };

return request(options);
return request(options).then((user) => {
if (user && user.displayName) {
user.displayName = Encoder.htmlDecode(user.displayName);
}
return user;
});
}

export function changePassword(userId, passwordHash, key) {
Expand Down Expand Up @@ -96,6 +101,11 @@ export function updateUser(data) {
method: "put",
url: `/people/${data.id}`,
data,
}).then((user) => {
if (user && user.displayName) {
user.displayName = Encoder.htmlDecode(user.displayName);
}
return user;
});
}

Expand Down

0 comments on commit f06283b

Please sign in to comment.