From 2395202d230930950cd8a33c9e70782aa9af700c Mon Sep 17 00:00:00 2001 From: Fedor Katurov Date: Wed, 22 Sep 2021 16:54:12 +0700 Subject: [PATCH] fixed profile submitting --- src/components/profile/ProfileSettings/index.tsx | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/src/components/profile/ProfileSettings/index.tsx b/src/components/profile/ProfileSettings/index.tsx index a1ca67f1..4333ed9b 100644 --- a/src/components/profile/ProfileSettings/index.tsx +++ b/src/components/profile/ProfileSettings/index.tsx @@ -48,16 +48,11 @@ const ProfileSettingsUnconnected: FC = ({ event => { event.preventDefault(); - const fields = reject(el => typeof el === 'undefined')({ - email: data.email !== user.email && data.email ? data.email : undefined, - fullname: data.fullname !== user.fullname ? data.fullname : undefined, - username: data.username !== user.username && data.username ? data.username : undefined, + const fields = { + ...data, password: password.length > 0 && password ? password : undefined, new_password: new_password.length > 0 && new_password ? new_password : undefined, - description: data.description !== user.description ? data.description : undefined, - }); - - if (Object.values(fields).length === 0) return; + }; authPatchUser(fields); },