mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#1556 Versand ins Ausland nicht erlauben
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { HttpErrorResponse } from '@angular/common/http';
|
||||
import { Component, ChangeDetectionStrategy, OnInit, ChangeDetectorRef } from '@angular/core';
|
||||
import { ActivatedRoute, Router } from '@angular/router';
|
||||
import { ApplicationService, ProcessService } from '@core/application';
|
||||
@@ -12,11 +13,12 @@ import {
|
||||
ShippingAddressDTO as CrmShippingAddressDTO,
|
||||
} from '@swagger/crm';
|
||||
import { UiMessageModalComponent, UiModalService } from '@ui/modal';
|
||||
import { isResponseArgs } from '@utils/object';
|
||||
import { ShippingAddressHelper } from 'apps/domain/crm/src/lib/helpers/shipping-address.helper';
|
||||
import { HistoryComponent } from 'apps/modal/history/src/lib/history.component';
|
||||
import { isBoolean } from 'lodash';
|
||||
import { Observable } from 'rxjs';
|
||||
import { first, map, shareReplay, switchMap } from 'rxjs/operators';
|
||||
import { Observable, of } from 'rxjs';
|
||||
import { catchError, first, map, shareReplay, switchMap } from 'rxjs/operators';
|
||||
import { CantAddCustomerToCartModalComponent } from '../modals/cant-add-customer-to-cart-modal/cant-add-customer-to-cart.component';
|
||||
import { CantAddCustomerToCartData } from '../modals/cant-add-customer-to-cart-modal/cant-add-customer-to-cart.data';
|
||||
import { CantSelectGuestModalComponent } from '../modals/cant-select-guest/cant-select-guest-modal.component';
|
||||
@@ -204,13 +206,21 @@ export class CustomerDetailsComponent implements OnInit {
|
||||
shippingAddress: shippingAddress.data,
|
||||
},
|
||||
})
|
||||
.pipe(
|
||||
catchError((err) => {
|
||||
if (err instanceof HttpErrorResponse && isResponseArgs(err.error)) {
|
||||
return of(Object.values(err.error.invalidProperties).join('; ') || err.error.message || err.message);
|
||||
}
|
||||
return of(err.message);
|
||||
})
|
||||
)
|
||||
.toPromise();
|
||||
|
||||
if (!isBoolean(canAddDestination)) {
|
||||
this.modal.open({
|
||||
content: UiMessageModalComponent,
|
||||
data: {
|
||||
title: 'Warenkobr kann dem Kunden nicht zugewiesen werden',
|
||||
title: 'Warenkorb kann dem Kunden nicht zugewiesen werden',
|
||||
message: canAddDestination,
|
||||
},
|
||||
});
|
||||
|
||||
@@ -31,6 +31,7 @@ const errorWhiteList: { url: string; codes: number[] }[] = [
|
||||
{ url: '/payer', codes: [400] },
|
||||
{ url: '/shippingaddress', codes: [400] },
|
||||
{ url: '/inventory', codes: [400] },
|
||||
{ url: '/destination/canadd', codes: [400] },
|
||||
];
|
||||
|
||||
const errorBlackList: { url: string; codes: number[] }[] = [{ url: '/order/checkout', codes: [400] }];
|
||||
|
||||
Reference in New Issue
Block a user