Carrello con scontistica aggiornata

This commit is contained in:
Surya Paolo
2023-12-18 12:11:22 +01:00
parent 265c8f4d9e
commit c1d60a7260
8 changed files with 41 additions and 13 deletions

View File

@@ -1754,9 +1754,23 @@ export const useUserStore = defineStore('UserStore', {
async importToServerCmd($q: any, t: any, cmd: number, data: any) {
return Api.SendReq('/admin/import', 'POST', { cmd, data })
.then((res) => {
.then((res: any) => {
if (res) {
tools.showPositiveNotif($q, t('db.recupdated'))
let msg = ''
if (res.data.imported) {
msg += ' ' + t('db.records_imported', {num: res.data.imported})
}
if (res.data.errors) {
msg += ' ' + t('db.records_errors', {num: res.data.errors})
}
if (res.data.updated) {
msg += ' ' + t('db.records_updated', {num: res.data.updated})
}
if (!msg) {
msg = t('db.recupdated')
}
tools.showPositiveNotif($q, msg)
}
}).catch((error) => {
tools.showNegativeNotif($q, t('db.recfailed'))