- corretto scheda prodotto, record salvato
This commit is contained in:
@@ -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à')
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user