Notifiche all'Utente

Pannello Utente (backoffice)
This commit is contained in:
Paolo Arena
2022-07-16 14:20:22 +02:00
parent 7f25ca4717
commit 7006d62cae
17 changed files with 174 additions and 32 deletions

View File

@@ -2303,6 +2303,13 @@ export const colTableUsersISP = [
jointable: 'permissions',
titlepopupedit: 'Permessi'
}),
AddCol({
name: 'notifs',
label_trans: 'reg.notifs',
fieldtype: costanti.FieldType.binary,
jointable: 'usernotifs',
titlepopupedit: 'Notifiche'
}),
AddCol({ name: 'ipaddr', label_trans: 'reg.ipaddr' }),
AddCol({ name: 'deleted', label_trans: 'reg.deleted', fieldtype: costanti.FieldType.boolean }),
AddCol(DeleteRec),
@@ -2700,6 +2707,15 @@ export const fieldsTable = {
colicon: 'icon',
noshow: true,
},
{
value: 'usernotifs',
label: 'Notifiche',
columns: colTableGeneric,
colkey: 'value',
collabel: 'label',
colicon: 'icon',
noshow: true,
},
{
value: 'sites',
label: 'Siti',

View File

@@ -54,6 +54,7 @@ export const DefaultUser: IUserFields = {
manage_mygroups: [],
asked_friends: [],
asked_groups: [],
notifs: 15,
},
cart: {
userId: '',
@@ -99,6 +100,7 @@ export const DefaultProfile: IUserProfile = {
manage_mygroups: [],
asked_friends: [],
asked_groups: [],
notifs: 15,
}
export const useUserStore = defineStore('UserStore', {
@@ -991,6 +993,21 @@ export const useUserStore = defineStore('UserStore', {
},
async setUserNotifs(notifs: number) {
const data = {
notifs
}
return Api.SendReq('/users/notifs', 'POST', data)
.then((ris) => {
return ris.data
}).catch((error) => {
return {}
})
},
async loadUserPanel(username: string) {
const data = {
username

View File

@@ -1591,6 +1591,7 @@ export const useGlobalStore = defineStore('GlobalStore', {
else if (table === toolsext.TABTYPEACCOM) myarr = shared_consts.TypeAccom
else if (table === toolsext.TABLOCACCOM) myarr = shared_consts.LocationAccom
else if (table === toolsext.TABPREF) myarr = shared_consts.Preferences
else if (table === 'usernotifs') myarr = shared_consts.UsersNotif_Adv_List
else myarr = this.getListByTable(table)
if (costanti.TABLES_ARRAY.includes(table)) {