From ad02f329e9076b3a835805ddd4771473b627daf3 Mon Sep 17 00:00:00 2001 From: Eric Sizer Date: Wed, 29 Mar 2023 14:31:25 -0400 Subject: [PATCH] exclude email from update user if not in data --- apps/web/src/pages/Users/UpdateUserPage/UpdateUserPage.tsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/apps/web/src/pages/Users/UpdateUserPage/UpdateUserPage.tsx b/apps/web/src/pages/Users/UpdateUserPage/UpdateUserPage.tsx index 0c34ce58510..01cbdeca7f8 100644 --- a/apps/web/src/pages/Users/UpdateUserPage/UpdateUserPage.tsx +++ b/apps/web/src/pages/Users/UpdateUserPage/UpdateUserPage.tsx @@ -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",