fix(deltagare, employee, avrop): Resetting params after destroy to avoid state issues. (TV-756)
Squashed commit of the following: commit 4cd30d9dafd2cbd17e5192142e5ba8116345fd18 Author: Erik Tiekstra <erik.tiekstra@arbetsformedlingen.se> Date: Tue Oct 12 19:55:32 2021 +0200 Added reset on destroy for all params when fetching lists
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { ChangeDetectionStrategy, Component } from '@angular/core';
|
||||
import { ChangeDetectionStrategy, Component, OnDestroy } from '@angular/core';
|
||||
import { IconType } from '@msfa-enums/icon-type.enum';
|
||||
import { EmployeeCompactResponse } from '@msfa-models/api/employee.response.model';
|
||||
import { Employee, EmployeesData } from '@msfa-models/employee.model';
|
||||
@@ -12,7 +12,7 @@ import { BehaviorSubject, Observable } from 'rxjs';
|
||||
styleUrls: ['./employees.component.scss'],
|
||||
changeDetection: ChangeDetectionStrategy.OnPush,
|
||||
})
|
||||
export class EmployeesComponent {
|
||||
export class EmployeesComponent implements OnDestroy {
|
||||
private _searchValue$ = new BehaviorSubject<string>('');
|
||||
onlyEmployeesWithoutAuthorization$: Observable<boolean> = this.employeeService.onlyEmployeesWithoutAuthorization$;
|
||||
employeesData$: Observable<EmployeesData> = this.employeeService.employeesData$;
|
||||
@@ -22,6 +22,10 @@ export class EmployeesComponent {
|
||||
|
||||
constructor(private employeeService: EmployeeService) {}
|
||||
|
||||
ngOnDestroy(): void {
|
||||
this.employeeService.resetParams();
|
||||
}
|
||||
|
||||
get searchValue(): string {
|
||||
return this._searchValue$.getValue();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user