Skip to content

Commit

Permalink
Merge pull request #6111 from GCTC-NTGC/bug_6103_prevent-unwanted-ema…
Browse files Browse the repository at this point in the history
…il-null

[Bug] Fix user role from removing email
  • Loading branch information
esizer authored Mar 30, 2023
2 parents 08902df + ad02f32 commit 74c65c9
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion apps/web/src/pages/Users/UpdateUserPage/UpdateUserPage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -311,7 +311,9 @@ const UpdateUserPage = () => {
id,
user: {
id,
email: emptyToNull(data.email),
// Do not include email in the request if it is not part of form data
// to prevent accidentally setting it to null
email: data.email !== undefined ? emptyToNull(data.email) : undefined,
...pick(data, [
"firstName",
"lastName",
Expand Down

0 comments on commit 74c65c9

Please sign in to comment.