forked from verdnatura/salix-front
Fix routes add ticket dialog
This commit is contained in:
parent
3c68f4779f
commit
4be9c02711
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue