mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#1576 Routing zu Customer Search bei Rechnungsadresse ändern
This commit is contained in:
@@ -336,25 +336,30 @@ export class CheckoutReviewComponent {
|
||||
const processId = this.applicationService.activatedProcessId;
|
||||
const customer = await this.domainCheckoutService.getBuyer({ processId }).pipe(first()).toPromise();
|
||||
if (!customer) {
|
||||
this.navigateToCustomerSearch(processId);
|
||||
return;
|
||||
}
|
||||
const customerId = customer.source;
|
||||
this.router.navigate(['/customer', `${customerId}`]);
|
||||
}
|
||||
|
||||
async navigateToCustomerSearch(processId: number) {
|
||||
const response = await this.customerFeatures$
|
||||
.pipe(
|
||||
first(),
|
||||
switchMap((customerFeatures) => {
|
||||
return this.domainCheckoutService.canSetCustomer({ processId, customerFeatures });
|
||||
})
|
||||
)
|
||||
.toPromise();
|
||||
this.router.navigate(['/customer', 'search'], { queryParams: { customertype: response.filter.customertype } });
|
||||
}
|
||||
|
||||
async order() {
|
||||
const processId = this.applicationService.activatedProcessId;
|
||||
const customer = await this.domainCheckoutService.getBuyer({ processId }).pipe(first()).toPromise();
|
||||
if (!customer) {
|
||||
const response = await this.customerFeatures$
|
||||
.pipe(
|
||||
first(),
|
||||
switchMap((customerFeatures) => {
|
||||
return this.domainCheckoutService.canSetCustomer({ processId, customerFeatures });
|
||||
})
|
||||
)
|
||||
.toPromise();
|
||||
this.router.navigate(['/customer', 'search'], { queryParams: { customertype: response.filter.customertype } });
|
||||
this.navigateToCustomerSearch(processId);
|
||||
} else {
|
||||
this.showOrderButtonSpinner = true;
|
||||
this.domainCheckoutService.completeCheckout({ processId }).subscribe(async () => {
|
||||
|
||||
Reference in New Issue
Block a user