- corretto scheda prodotto, record salvato

This commit is contained in:
Surya Paolo
2025-05-01 00:20:02 +02:00
parent 358f0d6816
commit 721d2ac38c
32 changed files with 296 additions and 177 deletions

View File

@@ -2674,6 +2674,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
try {
// aggiungi idapp ad options
options.idapp = tools.getEnv('VITE_APP_ID')
console.log('CHIAMATA fetchTableContent...', options)
return Api.SendReq('/apisqlsrv/view-table', 'POST', { options })
.then((res) => {
return res.data.data
@@ -2682,7 +2683,6 @@ export const useGlobalStore = defineStore('GlobalStore', {
})
} catch (error) {
console.error("Errore nel recupero della tabella:", error);
throw error;
}
},
@@ -2783,7 +2783,16 @@ export const useGlobalStore = defineStore('GlobalStore', {
if (index !== -1 && index !== undefined) {
// Aggiorna il record mantenendo reattività
mytablerec![index] = { ...mytablerec[index], ...resdata.rec }
if (datain.table === 'catalogs') {
// salva lista_prodotti
const prec_lista_prodotti = mytablerec![index].lista_prodotti
mytablerec![index] = { ...mytablerec[index], ...resdata.rec }
mytablerec![index].lista_prodotti = prec_lista_prodotti
} else {
mytablerec![index] = { ...mytablerec[index], ...resdata.rec }
console.log('Aggiorna il record mantenendo reattività')
}
}
}
}