Skip to content

Commit

Permalink
exclude email from update user if not in data
Browse files Browse the repository at this point in the history
  • Loading branch information
esizer committed Mar 29, 2023
1 parent ae28900 commit ad02f32
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 ad02f32

Please sign in to comment.