mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#4210 Änderungen werden nicht sofort angezeigt
This commit is contained in:
@@ -165,7 +165,7 @@ export class CustomerSearchComponent implements OnInit, OnDestroy {
|
||||
}
|
||||
|
||||
if (customerId !== this._store.customer?.id) {
|
||||
this._store.selectCustomer(customerId);
|
||||
this._store.selectCustomer({ customerId });
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -140,6 +140,8 @@ export abstract class CustomerDataEditComponent implements OnInit {
|
||||
|
||||
try {
|
||||
await this.customerService.patchCustomer(this.customerId, this.control.value).toPromise();
|
||||
this._store.selectCustomer({ customerId: this._store.customerId, reload: true });
|
||||
|
||||
this.location.back();
|
||||
} catch (error) {
|
||||
this.control.enable();
|
||||
|
||||
@@ -100,7 +100,7 @@ export class OrderDetailsMainViewComponent implements OnInit, OnDestroy {
|
||||
});
|
||||
|
||||
this.customerId$.pipe(takeUntil(this._onDestroy)).subscribe((customerId) => {
|
||||
this._store.selectCustomer(customerId);
|
||||
this._store.selectCustomer({ customerId });
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
@@ -77,7 +77,7 @@ export class CustomerOrderItemListItemComponent implements OnInit, OnDestroy {
|
||||
|
||||
ngOnInit() {
|
||||
this.customerId$.pipe(takeUntil(this._onDestroy)).subscribe((customerId) => {
|
||||
this._store.selectCustomer(+customerId);
|
||||
this._store.selectCustomer({ customerId });
|
||||
});
|
||||
|
||||
this.orderId$.pipe(takeUntil(this._onDestroy)).subscribe((orderId) => {
|
||||
|
||||
@@ -186,17 +186,17 @@ export class CustomerSearchStore extends ComponentStore<CustomerSearchState> imp
|
||||
|
||||
setProcessId = this.updater((state, processId: number) => ({ ...state, processId }));
|
||||
|
||||
selectCustomer = this.effect((customerId$: Observable<number>) =>
|
||||
customerId$.pipe(
|
||||
selectCustomer = this.effect((options$: Observable<{ customerId: number; reload?: boolean }>) =>
|
||||
options$.pipe(
|
||||
distinctUntilChanged(),
|
||||
filter((customerId) => !!customerId && Number(customerId) !== this.customerId),
|
||||
tap((custoemrId) => {
|
||||
this.patchState({ fetchingCustomer: true, customer: { id: custoemrId } });
|
||||
filter(({ customerId, reload }) => reload || (!!customerId && Number(customerId) !== this.customerId)),
|
||||
tap(({ customerId }) => {
|
||||
this.patchState({ fetchingCustomer: true, customer: { id: +customerId } });
|
||||
this.restoreCustomerInfo();
|
||||
}),
|
||||
switchMap((customerId) =>
|
||||
switchMap(({ customerId }) =>
|
||||
this._customerService
|
||||
.getCustomer(customerId, 2)
|
||||
.getCustomer(+customerId, 2)
|
||||
.pipe(tapResponse(this.handleSelectCustomerResponse, this.handleSelectCustomerError, this.handleSelectCustomerComplete))
|
||||
)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user