mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1228: #3104 Improved Error Handling of Removing Items from Shipping Document
#3104 Improved Error Handling of Removing Items from Shipping Document
This commit is contained in:
committed by
Andreas Schickinger
parent
913ffbda97
commit
e99d669086
@@ -72,7 +72,7 @@ export class SharedShippingDocumentDetailsComponent {
|
||||
async removeItem(item: ReceiptItemDTO) {
|
||||
try {
|
||||
this.loading = true;
|
||||
await this._remissionService
|
||||
const response = await this._remissionService
|
||||
.removeReturnItemFromReceipt({
|
||||
returnId: this.return.id,
|
||||
receiptId: this.firstReceipt.id,
|
||||
@@ -80,8 +80,12 @@ export class SharedShippingDocumentDetailsComponent {
|
||||
})
|
||||
.toPromise();
|
||||
this.loading = false;
|
||||
this.firstReceipt.items = this.firstReceipt.items.filter((i) => i.id !== item.id);
|
||||
this.itemDeleted.emit(item);
|
||||
if (!!response && !response?.error && Object.keys(response?.result)?.length > 0) {
|
||||
this.firstReceipt.items = this.firstReceipt.items.filter((i) => i.id !== item.id);
|
||||
this.itemDeleted.emit(item);
|
||||
} else {
|
||||
throw new Error('Keine Response vorhanden');
|
||||
}
|
||||
} catch (err) {
|
||||
this.loading = false;
|
||||
this._modal.open({ content: UiErrorModalComponent, title: 'Fehler beim Löschen des Artikels', data: err });
|
||||
|
||||
Reference in New Issue
Block a user