feat: notifications

This commit is contained in:
Jannat Patel
2024-05-22 20:40:02 +05:30
parent 8e1b871f87
commit f38aebbc9c
18 changed files with 4683 additions and 2102 deletions

View File

@@ -130,6 +130,11 @@ const routes = [
name: 'CertifiedParticipants',
component: () => import('@/pages/CertifiedParticipants.vue'),
},
{
path: '/notifications',
name: 'Notifications',
component: () => import('@/pages/Notifications.vue'),
},
]
let router = createRouter({
@@ -138,13 +143,21 @@ let router = createRouter({
})
router.beforeEach(async (to, from, next) => {
const { userResource } = usersStore()
const { userResource, allUsers } = usersStore()
let { isLoggedIn } = sessionStore()
try {
if (isLoggedIn) {
await userResource.reload()
}
if (
isLoggedIn &&
(to.name == 'Lesson' ||
to.name == 'Batch' ||
to.name == 'Notifications')
) {
await allUsers.reload()
}
} catch (error) {
isLoggedIn = false
}