diff --git a/src/app/_services/user.service.ts b/src/app/_services/user.service.ts index b2a0b90..787d700 100644 --- a/src/app/_services/user.service.ts +++ b/src/app/_services/user.service.ts @@ -90,17 +90,37 @@ export class UserService { }, location: {}, }; - accountInfo.vcard.fn[0].value = name; - accountInfo.vcard.n[0].value = name.split(' '); - accountInfo.vcard.tel[0].value = phoneNumber; - accountInfo.products = [bio]; - accountInfo.gender = gender; - accountInfo.age = age; - accountInfo.type = type; - accountInfo.category = businessCategory; - accountInfo.location.area = location; - accountInfo.location.area_name = userLocation; - accountInfo.location.area_type = locationType; + if (name) { + accountInfo.vcard.fn[0].value = name; + accountInfo.vcard.n[0].value = name.split(' '); + } + if (phoneNumber) { + accountInfo.vcard.tel[0].value = phoneNumber; + } + if (bio) { + accountInfo.products = [bio]; + } + if (gender) { + accountInfo.gender = gender; + } + if (age) { + accountInfo.age = age; + } + if (type) { + accountInfo.type = type; + } + if (businessCategory) { + accountInfo.category = businessCategory; + } + if (location) { + accountInfo.location.area = location; + } + if (userLocation) { + accountInfo.location.area_name = userLocation; + } + if (locationType) { + accountInfo.location.area_type = locationType; + } await vcardValidation(accountInfo.vcard); accountInfo.vcard = btoa(vCard.generate(accountInfo.vcard)); const accountKey: string = await User.toKey(address); diff --git a/src/app/pages/accounts/account-details/account-details.component.ts b/src/app/pages/accounts/account-details/account-details.component.ts index f2ecbcb..45295cf 100644 --- a/src/app/pages/accounts/account-details/account-details.component.ts +++ b/src/app/pages/accounts/account-details/account-details.component.ts @@ -94,7 +94,7 @@ export class AccountDetailsComponent implements OnInit { firstName: ['', Validators.required], lastName: ['', Validators.required], phoneNumber: ['', Validators.required], - age: ['', Validators.required], + age: [''], type: ['', Validators.required], bio: ['', Validators.required], gender: ['', Validators.required],