Wording und API

This commit is contained in:
Bastian Wagner
2026-02-19 17:19:03 +01:00
parent 7bd6dfae27
commit c542575046
4 changed files with 54 additions and 41 deletions

View File

@@ -10,7 +10,7 @@ import { MAT_DATE_LOCALE, provideNativeDateAdapter } from '@angular/material/cor
import { MatButtonModule } from '@angular/material/button';
import { AsyncPipe, DatePipe } from '@angular/common';
import { MatAutocompleteModule } from '@angular/material/autocomplete';
import { map, Observable, startWith, timestamp } from 'rxjs';
import { from, map, Observable, startWith, timestamp } from 'rxjs';
import {
MatBottomSheet,
MatBottomSheetModule,
@@ -99,7 +99,7 @@ export class HandoverDialogComponent {
this.isLoading = true;
const promises: Observable<any>[] = [
this.getHandovers(),
this.loadCustomers()
from(this.loadCustomers())
];
Promise.all(promises).then(() => {
@@ -125,20 +125,17 @@ export class HandoverDialogComponent {
}
loadCustomers() {
const promise = this.api.getCustomers()
promise.subscribe({
next: customers => {
this.customers = customers;
this.filteredCustomers = this.handoverForm.controls.customer.valueChanges.pipe(
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 || '')),
);
}
});
return promise;
);
resolve(customers)
});
}
private _filter(value: string): any[] {