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); },