diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts index 98316cc0c64..ce7efea7119 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.component.ts @@ -23,6 +23,7 @@ export const NODE_SELECT_VALUE_ACCESSOR: any = { export class FilingPlanComponent implements ControlValueAccessor, OnChanges { @Input() tenantIdentifier: number; + /** @deprecated should be removed */ @Input() accessContract: string; @Input() mode: FilingPlanMode; @Input() componentId: string = uuid(); @@ -51,7 +52,7 @@ export class FilingPlanComponent implements ControlValueAccessor, OnChanges { initFiningTree() { this.filingPlanService - .loadTree(this.tenantIdentifier, this.accessContract, this.componentId) + .loadTree(this.tenantIdentifier, this.componentId) .subscribe(nodes => { this.nestedDataSource.data = nodes; this.nestedTreeControl.dataNodes = nodes; @@ -60,7 +61,7 @@ export class FilingPlanComponent implements ControlValueAccessor, OnChanges { } ngOnChanges(changes: SimpleChanges): void { - if (changes.accessContract) { + if (changes.tenantIdentifier) { this.initFiningTree(); } } diff --git a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.ts b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.ts index 2e2e3015e2b..726f18c9ec8 100644 --- a/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.ts +++ b/ui/ui-frontend/projects/vitamui-library/src/lib/components/filing-plan/filing-plan.service.ts @@ -81,13 +81,13 @@ export class FilingPlanService { this.cache[accessContractId] = { value }; } - public loadTree(tenantIdentifier: number, accessContractId: string, idPrefix: string): Observable { - let units$ = this.getCachedValue(accessContractId); + public loadTree(tenantIdentifier: number, idPrefix: string): Observable { + const tenantId = tenantIdentifier.toString(); + let units$ = this.getCachedValue(tenantId); if (!units$) { this._pending++; const headers = new HttpHeaders({ - 'X-Tenant-Id': tenantIdentifier.toString(), - 'X-Access-Contract-Id': accessContractId, + 'X-Tenant-Id': tenantId, }); units$ = this.searchUnitApi.getFilingPlan(headers).pipe( catchError(() => { @@ -97,7 +97,7 @@ export class FilingPlanService { tap(() => this._pending--), shareReplay(1) ); - this.setCachedValue(units$, accessContractId); + this.setCachedValue(units$, tenantId); } return units$.pipe( map((results) => {