Impersination backend
This commit is contained in:
@@ -26,6 +26,7 @@ import { AG_GRID_LOCALE_DE } from '@ag-grid-community/locale';
|
||||
import { AgGridAngular } from 'ag-grid-angular';
|
||||
import { MatIconModule } from '@angular/material/icon';
|
||||
import { AgGridContainerComponent } from '../../../../shared/ag-grid/components/ag-grid-container/ag-grid-container.component';
|
||||
import { ICustomer } from '../../../../model/interface/customer.interface';
|
||||
|
||||
@Component({
|
||||
selector: 'app-handover-dialog',
|
||||
@@ -82,8 +83,8 @@ export class HandoverDialogComponent extends AgGridContainerComponent {
|
||||
|
||||
isLoading: boolean = false;
|
||||
|
||||
customers: { name: string, id: string }[] = [];
|
||||
filteredCustomers: Observable<any[]> = new Observable();
|
||||
customers: ICustomer[] = [];
|
||||
filteredCustomers: Observable<ICustomer[]> = new Observable();
|
||||
|
||||
handoverForm = new FormGroup({
|
||||
customer: new FormControl<any>(null, Validators.required),
|
||||
@@ -125,18 +126,14 @@ export class HandoverDialogComponent extends AgGridContainerComponent {
|
||||
return promise;
|
||||
}
|
||||
|
||||
loadCustomers() {
|
||||
|
||||
|
||||
return new Promise(async resolve => {
|
||||
const customers = await this.api.getCustomers();
|
||||
this.customers = customers;
|
||||
this.filteredCustomers = this.handoverForm.controls.customer.valueChanges.pipe(
|
||||
startWith(''),
|
||||
map(value => this._filter(value || '')),
|
||||
);
|
||||
resolve(customers)
|
||||
});
|
||||
async loadCustomers() {
|
||||
const customers = await this.api.refreshCustomers()
|
||||
this.customers = customers;
|
||||
this.filteredCustomers = this.handoverForm.controls.customer.valueChanges.pipe(
|
||||
startWith(''),
|
||||
map(value => this._filter(value || '')),
|
||||
);
|
||||
return Promise.resolve()
|
||||
}
|
||||
|
||||
private _filter(value: string): any[] {
|
||||
|
||||
Reference in New Issue
Block a user