Skip to content

Commit f23db17

Browse files
committed
fix(taxonomy): add missing filter in TaxonSheetService
1 parent 722395e commit f23db17

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

frontend/src/app/syntheseModule/taxon-sheet/taxon-sheet.service.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { Injectable } from '@angular/core';
2+
import { ConfigService } from '@geonature/services/config.service';
23
import { DataFormService } from '@geonature_common/form/data-form.service';
34
import { Taxon } from '@geonature_common/form/taxonomy/taxonomy.component';
45
import { BehaviorSubject } from 'rxjs';
@@ -7,7 +8,10 @@ import { BehaviorSubject } from 'rxjs';
78
export class TaxonSheetService {
89
taxon: BehaviorSubject<Taxon | null> = new BehaviorSubject<Taxon | null>(null);
910

10-
constructor(private _ds: DataFormService) {}
11+
constructor(
12+
private _ds: DataFormService,
13+
public config: ConfigService
14+
) {}
1115

1216
updateTaxonByCdRef(cd_ref: number) {
1317
const taxon = this.taxon.getValue();
@@ -16,6 +20,9 @@ export class TaxonSheetService {
1620
}
1721
const taxhubFields = ['attributs', 'attributs.bib_attribut.label_attribut', 'status'];
1822
this._ds.getTaxonInfo(cd_ref, taxhubFields).subscribe((taxon) => {
23+
taxon['attributs'] = taxon['attributs'].filter((v) => {
24+
return this.config.SYNTHESE.ID_ATTRIBUT_TAXHUB.includes(v.id_attribut);
25+
});
1926
this.taxon.next(taxon);
2027
});
2128
}

0 commit comments

Comments
 (0)