Add person verification to last step.

This commit is contained in:
Spencer Ofwiti 2021-04-27 20:22:42 +03:00
parent 21444304c6
commit 88dc73cf1d
2 changed files with 3 additions and 9 deletions

View File

@ -67,8 +67,7 @@ export class UserService {
} }
async changeAccountInfo(address: string, name: string, phoneNumber: string, age: string, type: string, bio: string, gender: string, async changeAccountInfo(address: string, name: string, phoneNumber: string, age: string, type: string, bio: string, gender: string,
businessCategory: string, userLocation: string, location: string, locationType: string, dateRegistered: string, businessCategory: string, userLocation: string, location: string, locationType: string
identities: any,
): Promise<any> { ): Promise<any> {
let accountInfo: any = { let accountInfo: any = {
vcard: { vcard: {
@ -89,12 +88,8 @@ export class UserService {
accountInfo.location.area = location; accountInfo.location.area = location;
accountInfo.location.area_name = userLocation; accountInfo.location.area_name = userLocation;
accountInfo.location.area_type = locationType; accountInfo.location.area_type = locationType;
accountInfo.date_registered = dateRegistered;
accountInfo.identities = identities;
await vcardValidation(accountInfo.vcard); await vcardValidation(accountInfo.vcard);
accountInfo.vcard = btoa(vCard.generate(accountInfo.vcard)); accountInfo.vcard = btoa(vCard.generate(accountInfo.vcard));
await personValidation(accountInfo);
delete accountInfo.identities;
const accountKey = await User.toKey(address); const accountKey = await User.toKey(address);
this.getAccountDetailsFromMeta(accountKey).pipe(first()).subscribe(async res => { this.getAccountDetailsFromMeta(accountKey).pipe(first()).subscribe(async res => {
const syncableAccount: Syncable = Envelope.fromJSON(JSON.stringify(res)).unwrap(); const syncableAccount: Syncable = Envelope.fromJSON(JSON.stringify(res)).unwrap();
@ -103,6 +98,7 @@ export class UserService {
update.push(new ArgPair(prop, accountInfo[prop])); update.push(new ArgPair(prop, accountInfo[prop]));
} }
syncableAccount.update(update, 'client-branch'); syncableAccount.update(update, 'client-branch');
await personValidation(syncableAccount.m.data);
await this.updateMeta(syncableAccount, accountKey, this.headers); await this.updateMeta(syncableAccount, accountKey, this.headers);
}, async error => { }, async error => {
this.loggingService.sendErrorLevelMessage('Can\'t find account info in meta service', this, {error}); this.loggingService.sendErrorLevelMessage('Can\'t find account info in meta service', this, {error});

View File

@ -151,9 +151,7 @@ export class AccountDetailsComponent implements OnInit {
this.accountInfoFormStub.businessCategory.value, this.accountInfoFormStub.businessCategory.value,
this.accountInfoFormStub.userLocation.value, this.accountInfoFormStub.userLocation.value,
this.accountInfoFormStub.location.value, this.accountInfoFormStub.location.value,
this.accountInfoFormStub.locationType.value, this.accountInfoFormStub.locationType.value
this.account.date_registered,
this.account.identities
); );
this.submitted = false; this.submitted = false;
} }