mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
fixed profile submitting
This commit is contained in:
parent
d7b86202eb
commit
2395202d23
1 changed files with 3 additions and 8 deletions
|
@ -48,16 +48,11 @@ const ProfileSettingsUnconnected: FC<IProps> = ({
|
||||||
event => {
|
event => {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
|
|
||||||
const fields = reject(el => typeof el === 'undefined')({
|
const fields = {
|
||||||
email: data.email !== user.email && data.email ? data.email : undefined,
|
...data,
|
||||||
fullname: data.fullname !== user.fullname ? data.fullname : undefined,
|
|
||||||
username: data.username !== user.username && data.username ? data.username : undefined,
|
|
||||||
password: password.length > 0 && password ? password : undefined,
|
password: password.length > 0 && password ? password : undefined,
|
||||||
new_password: new_password.length > 0 && new_password ? new_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);
|
authPatchUser(fields);
|
||||||
},
|
},
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue