Refactor patching of location and category information to autofil from bio and user location.
This commit is contained in:
parent
6904127876
commit
06326aa0bf
@ -1151,7 +1151,7 @@ export class MockBackendInterceptor implements HttpInterceptor {
|
||||
const queriedCategory: Category = categories.find((category) =>
|
||||
category.products.includes(stringFromUrl())
|
||||
);
|
||||
return ok(queriedCategory.name);
|
||||
return ok(queriedCategory.name || 'other');
|
||||
}
|
||||
|
||||
function getAreaNames(): Observable<HttpResponse<any>> {
|
||||
@ -1163,7 +1163,7 @@ export class MockBackendInterceptor implements HttpInterceptor {
|
||||
const queriedAreaName: AreaName = areaNames.find((areaName) =>
|
||||
areaName.locations.includes(stringFromUrl())
|
||||
);
|
||||
return ok(queriedAreaName.name);
|
||||
return ok(queriedAreaName.name || 'other');
|
||||
}
|
||||
|
||||
function getAreaTypes(): Observable<HttpResponse<any>> {
|
||||
@ -1175,7 +1175,7 @@ export class MockBackendInterceptor implements HttpInterceptor {
|
||||
const queriedAreaType: AreaType = areaTypes.find((areaType) =>
|
||||
areaType.area.includes(stringFromUrl())
|
||||
);
|
||||
return ok(queriedAreaType.name);
|
||||
return ok(queriedAreaType.name || 'other');
|
||||
}
|
||||
|
||||
function getAccountTypes(): Observable<HttpResponse<any>> {
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user