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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const updates = selectedRows.value?.map((ticket) => ({
|
await Promise.all(
|
||||||
where: {
|
(selectedRows.value || [])
|
||||||
id: ticket.id,
|
.filter((ticket) => ticket?.id)
|
||||||
data: {
|
.map((ticket) =>
|
||||||
routeFk: $props.id,
|
axios.patch(`Routes/${$props.id}/insertTicket`, { ticketId: ticket.id })
|
||||||
},
|
)
|
||||||
},
|
);
|
||||||
}));
|
|
||||||
|
|
||||||
await axios.post(`Tickets/crud`, { updates });
|
|
||||||
await axios.post(`Routes/${$props.id}/updateVolume`);
|
await axios.post(`Routes/${$props.id}/updateVolume`);
|
||||||
emit('ok');
|
emit('ok');
|
||||||
emit('hide');
|
emit('hide');
|
||||||
|
|
Loading…
Reference in New Issue