diff --git a/src/pages/Ticket/Card/TicketSale.vue b/src/pages/Ticket/Card/TicketSale.vue index 767c31cdd..2dc67872f 100644 --- a/src/pages/Ticket/Card/TicketSale.vue +++ b/src/pages/Ticket/Card/TicketSale.vue @@ -388,17 +388,18 @@ const removeSelectedSales = () => { }; const removeSales = async () => { - let paramsOk = true; try { - const params = { sales: selectedRows.value, ticketId: store.data.id }; - params.sales.forEach((sale) => { - if (!sale.itemFk) { - tableRef.value.reload(); - paramsOk = false; - } - }); + const params = { + sales: selectedRows.value.filter((sale) => sale.id), + ticketId: store.data.id, + }; + selectedRows.value + .filter((sale) => !sale.id) + .forEach((sale) => + tableRef.value.CrudModelRef.formData.splice(sale.$index, 1) + ); - if (!paramsOk) return; + if (params.sales.length == 0) return; await axios.post('Sales/deleteSales', params); removeSelectedSales(); notify('globals.dataSaved', 'positive');