Carrello con scontistica aggiornata
This commit is contained in:
@@ -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'))
|
||||
|
||||
Reference in New Issue
Block a user