refactor(TicketDetails): actualizar deleteRow para usar nuevo endpoint e incluir ID de orden
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
gitea/hedera-web/pipeline/pr-beta This commit looks good
Details
This commit is contained in:
parent
aa66c086f2
commit
e84e31a7b4
|
@ -35,27 +35,22 @@ defineProps({
|
|||
});
|
||||
|
||||
const emit = defineEmits(['onRowDeleted']);
|
||||
const jApi = inject('jApi');
|
||||
const api = inject('api');
|
||||
const { t } = useI18n();
|
||||
const { openConfirmationModal } = useVnConfirm();
|
||||
|
||||
const lineDiscountSubtotal = line => {
|
||||
return line.quantity * line.price;
|
||||
};
|
||||
|
||||
const lineSubtotal = line =>
|
||||
lineDiscountSubtotal(line) * ((100 - line.discount) / 100);
|
||||
|
||||
const deleteRow = id => {
|
||||
const deleteRow = async (id, orderFk) => {
|
||||
try {
|
||||
jApi.execQuery(
|
||||
`START TRANSACTION;
|
||||
DELETE FROM hedera.myOrderRow WHERE ((id = #id));
|
||||
COMMIT`,
|
||||
{
|
||||
id
|
||||
}
|
||||
);
|
||||
await api.post('/orderRows/removes', {
|
||||
rows: [id],
|
||||
actualOrderId: orderFk
|
||||
});
|
||||
emit('onRowDeleted');
|
||||
} catch (error) {
|
||||
console.error('Error deleting order item:', error);
|
||||
|
@ -123,7 +118,7 @@ const deleteRow = id => {
|
|||
openConfirmationModal(
|
||||
null,
|
||||
t('confirmDelete'),
|
||||
() => deleteRow(row.id)
|
||||
() => deleteRow(row.id, ticket.id)
|
||||
)
|
||||
"
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue