backend notifications implementation

This commit is contained in:
Čarodej
2022-03-10 11:49:02 +01:00
parent 70d7f2f5bd
commit 64e80d387b
20 changed files with 617 additions and 280 deletions

View File

@@ -18,6 +18,7 @@ const actions = {
resolve(response)
commit('RETRIEVE_USER', response.data)
commit('UPDATE_NOTIFICATION_COUNT', response.data.data.relationships.unreadNotifications.data.length)
if (! getters.isRunningConnection) {
dispatch('runConnection')
@@ -172,6 +173,13 @@ const mutations = {
}
})
},
PUSH_NEW_NOTIFICATION(state, notification) {
state.user.data.relationships.unreadNotifications.data.push(notification)
},
FLUSH_NOTIFICATIONS(state) {
state.user.data.relationships.readNotifications.data = []
state.user.data.relationships.unreadNotifications.data = []
},
}
const getters = {