Refactor outgoing metadata to reflect schema.
This commit is contained in:
parent
cb14b9b5dc
commit
21444304c6
@ -4,7 +4,7 @@ async function personValidation(person: any): Promise<void> {
|
|||||||
const personValidationErrors = await validatePerson(person);
|
const personValidationErrors = await validatePerson(person);
|
||||||
|
|
||||||
if (personValidationErrors) {
|
if (personValidationErrors) {
|
||||||
personValidationErrors.map(error => console.log(`${error.message}`));
|
personValidationErrors.map(error => console.error(`${error.message}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -12,7 +12,7 @@ async function vcardValidation(vcard: any): Promise<void> {
|
|||||||
const vcardValidationErrors = await validateVcard(vcard);
|
const vcardValidationErrors = await validateVcard(vcard);
|
||||||
|
|
||||||
if (vcardValidationErrors) {
|
if (vcardValidationErrors) {
|
||||||
vcardValidationErrors.map(error => console.log(`${error.message}`));
|
vcardValidationErrors.map(error => console.error(`${error.message}`));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,8 @@ 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,
|
businessCategory: string, userLocation: string, location: string, locationType: string, dateRegistered: string,
|
||||||
|
identities: any,
|
||||||
): Promise<any> {
|
): Promise<any> {
|
||||||
let accountInfo: any = {
|
let accountInfo: any = {
|
||||||
vcard: {
|
vcard: {
|
||||||
@ -88,9 +89,12 @@ 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);
|
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();
|
||||||
|
@ -152,6 +152,8 @@ export class AccountDetailsComponent implements OnInit {
|
|||||||
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;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user