From e54eb50265741bfd5e424e59c626df201d9dd1e3 Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 19 Nov 2024 15:35:57 +0100 Subject: [PATCH 1/2] fix: refs #8166 show zone error --- src/pages/Ticket/TicketAdvance.vue | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/pages/Ticket/TicketAdvance.vue b/src/pages/Ticket/TicketAdvance.vue index 8de602b37..c247a20bc 100644 --- a/src/pages/Ticket/TicketAdvance.vue +++ b/src/pages/Ticket/TicketAdvance.vue @@ -213,10 +213,7 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => { warehouseFk: ticket.futureWarehouseFk, }); - if (!newLanded) { - notify(t('advanceTickets.noDeliveryZone'), 'negative'); - return; - } + if (!newLanded) throw new Error(t('advanceTickets.noDeliveryZone')); ticket.landed = newLanded.landed; ticket.zoneFk = newLanded.zoneFk; @@ -299,10 +296,10 @@ const splitTickets = async () => { const { query, params } = await requestComponentUpdate(ticket, true); await axios.post(query, params); progressAdd(ticket.futureId); - } catch (error) { + } catch (e) { splitErrors.value.push({ id: ticket.futureId, - reason: error.response?.data?.error?.message, + reason: e.message || e.response?.data?.error?.message, }); progressAdd(ticket.futureId); } From 73b7fa7704eff4dbd3b95bca8d37294eafb19efc Mon Sep 17 00:00:00 2001 From: jorgep Date: Tue, 19 Nov 2024 15:43:55 +0100 Subject: [PATCH 2/2] feat: refs #8166 show notification --- src/pages/Ticket/TicketAdvance.vue | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/pages/Ticket/TicketAdvance.vue b/src/pages/Ticket/TicketAdvance.vue index c247a20bc..71e3926ac 100644 --- a/src/pages/Ticket/TicketAdvance.vue +++ b/src/pages/Ticket/TicketAdvance.vue @@ -213,7 +213,10 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => { warehouseFk: ticket.futureWarehouseFk, }); - if (!newLanded) throw new Error(t('advanceTickets.noDeliveryZone')); + if (!newLanded) { + notify(t('advanceTickets.noDeliveryZone'), 'negative'); + throw new Error(t('advanceTickets.noDeliveryZone')); + } ticket.landed = newLanded.landed; ticket.zoneFk = newLanded.zoneFk;