1
0
Fork 0
mirror of https://github.com/muerwre/vault-frontend.git synced 2025-04-25 04:46:40 +07:00

fixed calculation of empty fields on frontend

This commit is contained in:
Fedor Katurov 2020-08-26 16:35:24 +07:00
parent de7818c235
commit c9d84a4947
3 changed files with 17 additions and 15 deletions

View file

@ -48,13 +48,13 @@ const ProfileSettingsUnconnected: FC<IProps> = ({
event => {
event.preventDefault();
const fields = reject(el => !el)({
email: data.email !== user.email && data.email,
fullname: data.fullname !== user.fullname && data.fullname,
username: data.username !== user.username && data.username,
password: password.length > 0 && password,
new_password: new_password.length > 0 && new_password,
description: data.description !== user.description && data.description,
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,
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;