Notifiche all'Utente
Pannello Utente (backoffice)
This commit is contained in:
@@ -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',
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user