se sei sulla pagina, la notifica di "gia letto" non viene settata.

- aggiunto "RIS" ai tipi di contributi
- Amicizia accettata compare 2 volte nelle notifiche
- Bottone click sull utente non funziona
This commit is contained in:
Paolo Arena
2022-09-18 19:45:26 +02:00
parent da17c2b060
commit 193afa770b
23 changed files with 119 additions and 56 deletions

View File

@@ -118,6 +118,25 @@ export const useNotifStore = defineStore('NotifStore', {
})
},
setRead(_id: string) {
return Api.SendReq(`/sendnotif/set/${_id}/${process.env.APP_ID}`, 'GET', null)
.then((res) => {
// console.log('res', res)
if (res) {
const rec = this.last_notifs.find((rec: any) => rec._id === _id)
if (rec) {
rec.read = true
}
}
this.updateArrNotif()
})
.catch((error) => {
console.error(error)
return false
})
},
deleteRec(username: string, id: string) {
return Api.SendReq(`/sendnotif/del/${username}/${id}/${process.env.APP_ID}`, 'GET', null)
.then((res) => {