From 6ea0e1c7c3b9dc9ff652837debc39c414e285b59 Mon Sep 17 00:00:00 2001 From: Julien Corny Date: Mon, 15 Apr 2024 18:32:16 +0200 Subject: [PATCH] fix wrong rb name in tab9 --- frontend/app/services/hierarchy.service.ts | 6 +++--- frontend/app/zh-forms/tabs/tab9/zh-form-tab9.component.ts | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/frontend/app/services/hierarchy.service.ts b/frontend/app/services/hierarchy.service.ts index b65536e4..8f2359a6 100644 --- a/frontend/app/services/hierarchy.service.ts +++ b/frontend/app/services/hierarchy.service.ts @@ -38,8 +38,9 @@ export class HierarchyService { } // get current zone humides - getHierarchy(zhId) { + getHierarchy(zhId, rb_name) { this.isLoading = true; + this.rb_name = rb_name; this._dataService.getHierZh(zhId).subscribe( (data: HierarchyModel) => { this.items = this.setItems(data); @@ -65,8 +66,7 @@ export class HierarchyService { this.items = []; return; } - this.rb_name = data.river_basin_name; - + this.items = [{ name: '', active: true, qualification: '', knowledge: '', note: '' }]; // cat 1 diff --git a/frontend/app/zh-forms/tabs/tab9/zh-form-tab9.component.ts b/frontend/app/zh-forms/tabs/tab9/zh-form-tab9.component.ts index 25fbc1ba..e63a04d8 100755 --- a/frontend/app/zh-forms/tabs/tab9/zh-form-tab9.component.ts +++ b/frontend/app/zh-forms/tabs/tab9/zh-form-tab9.component.ts @@ -37,7 +37,7 @@ export class ZhFormTab9Component implements OnInit { this.$_currentZhSub = this._dataService.currentZh.subscribe((zh: any) => { if (zh) { this.currentZh = zh; - this.hierarchy.getHierarchy(zh.id); + this.hierarchy.getHierarchy(zh.id, zh.properties.bassin_versant); } }); }