fix: refs #4774 fix delete translations

This commit is contained in:
Carlos Satorres 2025-01-24 13:42:54 +01:00
parent dc93ec8fb5
commit 2b6909d60e
2 changed files with 8 additions and 8 deletions

View File

@ -149,7 +149,7 @@ function sendPdfInvoice({ address }) {
const createInvoiceInCorrection = async () => {
const { data: correctingId } = await axios.post(
'InvoiceIns/corrective',
Object.assign(correctionFormData, { id: entityId.value })
Object.assign(correctionFormData, { id: entityId.value }),
);
push({ path: `/invoice-in/${correctingId}/summary` });
};
@ -272,7 +272,6 @@ const createInvoiceInCorrection = async () => {
>
<template #option="{ itemProps, opt }">
<QItem v-bind="itemProps">
{{ console.log('opt: ', opt) }}
<QItemSection>
<QItemLabel
>{{ opt.id }} -

View File

@ -69,7 +69,7 @@ async function loadTable(data) {
row.en = row[field.value];
const translation = originalData.value.find(
(o) => o.lang == lang.value && o[primaryKey.value] == row[primaryKey.value]
(o) => o.lang == lang.value && o[primaryKey.value] == row[primaryKey.value],
);
row[lang.value] = translation?.[field.value];
@ -90,6 +90,7 @@ function resetOriginalData() {
}
async function save(data, changes) {
const { deletes } = data;
const { updates, creates } = changes();
for (const update of updates ?? []) {
@ -105,7 +106,7 @@ async function save(data, changes) {
delete create[lang.value];
}
await axios.post(url.value + '/crud', { updates, creates });
await axios.post(url.value + '/crud', { updates, creates, deletes });
tableRef.value.reload();
tableRef.value.CrudModelRef.hasChanges = false;
}