0
0
Fork 0

Fix routes add ticket dialog

This commit is contained in:
Kevin Martinez 2024-02-27 12:41:42 -03:00
parent 3c68f4779f
commit 4be9c02711
1 changed files with 7 additions and 10 deletions

View File

@ -102,16 +102,13 @@ const setTicketsRoute = async () => {
return;
}
const updates = selectedRows.value?.map((ticket) => ({
where: {
id: ticket.id,
data: {
routeFk: $props.id,
},
},
}));
await axios.post(`Tickets/crud`, { updates });
await Promise.all(
(selectedRows.value || [])
.filter((ticket) => ticket?.id)
.map((ticket) =>
axios.patch(`Routes/${$props.id}/insertTicket`, { ticketId: ticket.id })
)
);
await axios.post(`Routes/${$props.id}/updateVolume`);
emit('ok');
emit('hide');