email da inviare ai clienti ...
This commit is contained in:
@@ -15,6 +15,7 @@ import {
|
||||
IColGridTable,
|
||||
ISignupIscrizioneConacreisOptions,
|
||||
ISignupIscrizioneArcadeiOptions,
|
||||
ISettings,
|
||||
} from '@src/model'
|
||||
import { tools } from '@store/Modules/tools'
|
||||
import translate from '@src/globalroutines/util'
|
||||
@@ -1021,11 +1022,26 @@ export const useUserStore = defineStore('UserStore', {
|
||||
}
|
||||
},
|
||||
|
||||
async newsletterload(paramquery: any) {
|
||||
async newsletterload(force: boolean) {
|
||||
|
||||
return Api.SendReq('/news/load', 'POST', paramquery)
|
||||
.then((res) => {
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
const mydata = {
|
||||
locale: tools.getLocale()
|
||||
}
|
||||
|
||||
if ((globalStore.serv_settings.length > 0) && !force)
|
||||
return null;
|
||||
|
||||
return Api.SendReq('/news/load', 'POST', mydata)
|
||||
.then((res: any) => {
|
||||
// console.log('res', res)
|
||||
if (res.data) {
|
||||
globalStore.serv_settings = res.data.serv_settings
|
||||
globalStore.templemail = res.data.templemail
|
||||
globalStore.opzemail = res.data.opzemail
|
||||
}
|
||||
|
||||
return res.data
|
||||
}).catch((error) => {
|
||||
return null
|
||||
@@ -1117,10 +1133,10 @@ export const useUserStore = defineStore('UserStore', {
|
||||
this.usersList = [...usersList]
|
||||
},
|
||||
|
||||
setlang($q: any, $router: Router, newstr: string) {
|
||||
setlang($q: any, router: Router, newstr: string) {
|
||||
console.log('SETLANG', newstr)
|
||||
this.lang = newstr
|
||||
toolsext.setLangAtt($q, $router, newstr)
|
||||
toolsext.setLangAtt($q, router, newstr)
|
||||
tools.localStSetItem(toolsext.localStorage.lang, this.lang)
|
||||
},
|
||||
|
||||
@@ -1258,7 +1274,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
},
|
||||
|
||||
async signin($router: Router, authData: ISigninOptions) {
|
||||
async signin(router: Router, authData: ISigninOptions) {
|
||||
console.log('LOGIN signin')
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
@@ -1321,7 +1337,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
}).then((code) => {
|
||||
if (code === tools.OK) {
|
||||
return this.setGlobal($router, true)
|
||||
return this.setGlobal(router, true)
|
||||
.then(() => {
|
||||
return code
|
||||
})
|
||||
@@ -1338,7 +1354,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
async logout() {
|
||||
const globalStore = useGlobalStore()
|
||||
// const $router = useRouter()
|
||||
|
||||
|
||||
console.log('logout')
|
||||
|
||||
@@ -1375,7 +1391,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
})
|
||||
},
|
||||
|
||||
async setGlobal($router: Router, isLogged: boolean) {
|
||||
async setGlobal(router: Router, isLogged: boolean) {
|
||||
console.log('setGlobal', isLogged)
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
@@ -1405,7 +1421,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
if (globalStore.site.confpages.enableProj)
|
||||
await projects.dbLoad({ checkPending: true, onlyiffirsttime: true })
|
||||
|
||||
globalStore.addDynamicPages($router)
|
||||
globalStore.addDynamicPages(router)
|
||||
|
||||
static_data.lang_available = globalStore.getLangAvailable()
|
||||
|
||||
@@ -1426,7 +1442,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
// console.log('setGlobal: END')
|
||||
},
|
||||
|
||||
async autologin_FromLocalStorage($router: Router, $q: any) {
|
||||
async autologin_FromLocalStorage(router: Router, $q: any) {
|
||||
try {
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
@@ -1454,7 +1470,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
isLogged = tools.isLogged()
|
||||
}
|
||||
|
||||
return await this.setGlobal($router, isLogged)
|
||||
return await this.setGlobal(router, isLogged)
|
||||
.then((loadstorage: any) => {
|
||||
// console.log('RISULT setGlobal:', loadstorage)
|
||||
if (loadstorage) {
|
||||
@@ -1758,15 +1774,15 @@ export const useUserStore = defineStore('UserStore', {
|
||||
.then((res: any) => {
|
||||
if (res) {
|
||||
let msg = ''
|
||||
|
||||
|
||||
if (res.data.imported) {
|
||||
msg += ' ' + t('db.records_imported', {num: 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})
|
||||
msg += ' ' + t('db.records_errors', { num: res.data.errors })
|
||||
}
|
||||
if (res.data.updated) {
|
||||
msg += ' ' + t('db.records_updated', {num: res.data.updated})
|
||||
msg += ' ' + t('db.records_updated', { num: res.data.updated })
|
||||
}
|
||||
if (!msg) {
|
||||
msg = t('db.recupdated')
|
||||
@@ -1931,7 +1947,7 @@ export const useUserStore = defineStore('UserStore', {
|
||||
|
||||
const globalStore = useGlobalStore()
|
||||
|
||||
if (globalStore.site && (!globalStore.site.confpages.showCoins && !globalStore.site.confpages.showRIS)) {
|
||||
if (globalStore.site && (!globalStore.site.confpages.showCoins && !globalStore.site.confpages.showRIS)) {
|
||||
return false
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user