Refactor patching of location and category information to autofil from bio and user location.

This commit is contained in:
Spencer Ofwiti
2021-06-02 12:59:37 +03:00
parent 6904127876
commit 06326aa0bf
2 changed files with 22 additions and 6 deletions

View File

@@ -119,10 +119,26 @@ export class AccountDetailsComponent implements OnInit {
type: this.account.type,
bio: this.account.products,
gender: this.account.gender,
businessCategory: this.account.category,
businessCategory:
this.account.category ||
this.userService.getCategoryByProduct(this.account.products[0]),
userLocation: this.account.location.area_name,
location: this.account.location.area,
locationType: this.account.location.area_type,
location:
this.account.location.area ||
this.locationService
.getAreaNameByLocation(this.account.location.area_name)
.pipe(first())
.subscribe((response) => {
return response;
}),
locationType:
this.account.location.area_type ||
this.locationService
.getAreaTypeByArea(this.accountInfoFormStub.location.value)
.pipe(first())
.subscribe((response) => {
return response;
}),
});
this.userService
.getAccountStatus(this.account.vcard?.tel[0].value)