From c9cfb2b1cf38854ca7c7d36217c25776540a8cd5 Mon Sep 17 00:00:00 2001 From: jorgep Date: Thu, 24 Oct 2024 12:29:46 +0200 Subject: [PATCH 1/4] fix: refs #7524 changes --- src/pages/Ticket/TicketAdvance.vue | 57 ++++++++++++------------------ 1 file changed, 22 insertions(+), 35 deletions(-) diff --git a/src/pages/Ticket/TicketAdvance.vue b/src/pages/Ticket/TicketAdvance.vue index f6fb37e21..7db2b54b3 100644 --- a/src/pages/Ticket/TicketAdvance.vue +++ b/src/pages/Ticket/TicketAdvance.vue @@ -243,36 +243,31 @@ const requestComponentUpdate = async (ticket, isWithoutNegatives) => { }; const moveTicketsAdvance = async () => { - try { - let ticketsToMove = []; - for (const ticket of selectedTickets.value) { - if (!ticket.id) { - try { - const { query, params } = await requestComponentUpdate(ticket, false); - axios.post(query, params); - } catch (e) { - console.error('Error moving ticket', e); - } - continue; + let ticketsToMove = []; + for (const ticket of selectedTickets.value) { + if (!ticket.id) { + try { + const { query, params } = await requestComponentUpdate(ticket, false); + axios.post(query, params); + } catch (e) { + console.error('Error moving ticket', e); } - ticketsToMove.push({ - originId: ticket.futureId, - destinationId: ticket.id, - originShipped: ticket.futureShipped, - destinationShipped: ticket.shipped, - workerFk: ticket.workerFk, - }); + continue; } - - const params = { tickets: ticketsToMove }; - await axios.post('Tickets/merge', params); - vnTableRef.value.reload(); - selectedTickets.value = []; - if (ticketsToMove.length) - notify(t('advanceTickets.moveTicketSuccess'), 'positive'); - } catch (error) { - console.error('Error moving tickets', error); + ticketsToMove.push({ + originId: ticket.futureId, + destinationId: ticket.id, + originShipped: ticket.futureShipped, + destinationShipped: ticket.shipped, + workerFk: ticket.workerFk, + }); } + + const params = { tickets: ticketsToMove }; + await axios.post('Tickets/merge', params); + vnTableRef.value.reload(); + selectedTickets.value = []; + if (ticketsToMove.length) notify(t('advanceTickets.moveTicketSuccess'), 'positive'); }; const progressLength = ref(0); @@ -313,8 +308,6 @@ const splitTickets = async () => { progressAdd(ticket.futureId); } } - } catch (error) { - console.error('Error splitting tickets', error); } finally { vnTableRef.value.reload(); } @@ -400,12 +393,6 @@ watch( auto-load @on-fetch="(data) => (zonesOptions = data)" /> - -