Notification: Set a new Friendship and Accepted Friendship

This commit is contained in:
Paolo Arena
2022-07-26 15:46:29 +02:00
parent e2006e683b
commit 43619ec719
15 changed files with 78 additions and 39 deletions

View File

@@ -92,6 +92,7 @@ export const Api = {
idapp: process.env.APP_ID,
}
console.log('INIZIO - SendReq', url)
// console.log('mydata', mydata)
const userStore = useUserStore()
@@ -138,7 +139,7 @@ export const Api = {
}
}, 1000)
console.log('error', error)
console.log('ERROR', error)
return reject(error)
}))
},

View File

@@ -18,8 +18,7 @@ export const useNotifStore = defineStore('NotifStore', {
getters: {
getlasts_notifs: (mystate: INotifState) => (): INotif[] => {
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 10).filter((rec) => mystate.show_all ? true : !rec.read) : []
// const ctrec = (mystate.notifs) ? mystate.notifs.slice().reverse().slice(0, 5) : []
const ctrec = (mystate.last_notifs) ? mystate.last_notifs.slice(0, 20).filter((rec) => mystate.show_all ? true : !rec.read) : []
return (ctrec)
},
@@ -131,6 +130,7 @@ export const useNotifStore = defineStore('NotifStore', {
data.typeid = notif.typeid
data.sender = notif.sender
data.dest = notif.dest
data.title = notif.title
data.descr = notif.descr
data.datenotif = tools.getDateNow()
data.read = false

View File

@@ -1062,10 +1062,11 @@ export const useUserStore = defineStore('UserStore', {
},
async loadGeneric(table: string, id: number) {
async loadGeneric(table: string, id: number, idnotif: string) {
const data = {
table,
id
id,
idnotif
}
return Api.SendReq('/mygen/page', 'POST', data)