diff --git a/src/pages/Route/Card/RouteListTicketsDialog.vue b/src/pages/Route/Card/RouteListTicketsDialog.vue index e5a8ac2b9..cc4515158 100644 --- a/src/pages/Route/Card/RouteListTicketsDialog.vue +++ b/src/pages/Route/Card/RouteListTicketsDialog.vue @@ -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');