From 6fd8ba36e4b988cc818ea7ef90940393a60be2b2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9sar=20M=2E=20Crist=C3=B3bal?= Date: Mon, 9 Sep 2024 14:00:28 +0200 Subject: [PATCH] =?UTF-8?q?77=20actualizaci=C3=B3n=20packagesjson=20(#86)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * añadimos install activate y fetch al service worker * fix fmt * actualización de paquetes * validate refuse refactor * Add test for get-user-notifications * notifications test * fix notification tests * wip test validate refuse * fix estilos de los filtros de notificaciones * nuevo servicio para comprobar si hay nombres repetidos * si hay alguna peña con un nombre parecido, lo mostramos y pedimos confirmación * validate refuse test * escribiendo test con playwright * fix reset button * test for wellcome modal * fix sonar issues * add sonar properties --- package.json | 4 +- sonar-project.properties | 23 + src/lib/{utils => }/gang/add-gang.test.ts | 0 src/lib/{utils => }/gang/add-gang.ts | 2 +- .../gang/request-new-member.test.ts | 0 .../{utils => }/gang/request-new-member.ts | 2 +- .../get-user-notifications.test.ts | 81 ++ .../notification/get-user-notifications.ts | 16 +- .../notification-subscribe-user.ts | 13 +- src/lib/notification/notifications.test.ts | 66 ++ .../{utils => }/notification/notifications.ts | 3 +- src/lib/notification/validate-refuse.test.ts | 288 ++++++++ src/lib/notification/validate-refuse.ts | 85 +++ src/routes/+layout.server.ts | 10 +- src/routes/+layout.svelte | 2 +- src/routes/gang/[slug]/+page.server.ts | 2 +- src/routes/gang/add/+page.server.ts | 4 +- src/routes/notification/my/+page.server.ts | 73 +- src/routes/notification/send/+server.ts | 53 -- tests/nav.test.ts | 9 + tests/test.ts | 6 - tests/wellcome-modal.test.ts | 12 + yarn.lock | 697 +++++++++--------- 23 files changed, 922 insertions(+), 529 deletions(-) create mode 100644 sonar-project.properties rename src/lib/{utils => }/gang/add-gang.test.ts (100%) rename src/lib/{utils => }/gang/add-gang.ts (95%) rename src/lib/{utils => }/gang/request-new-member.test.ts (100%) rename src/lib/{utils => }/gang/request-new-member.ts (96%) create mode 100644 src/lib/notification/get-user-notifications.test.ts rename src/lib/{utils => }/notification/get-user-notifications.ts (70%) rename src/lib/{utils => }/notification/notification-subscribe-user.ts (71%) create mode 100644 src/lib/notification/notifications.test.ts rename src/lib/{utils => }/notification/notifications.ts (96%) create mode 100644 src/lib/notification/validate-refuse.test.ts create mode 100644 src/lib/notification/validate-refuse.ts delete mode 100644 src/routes/notification/send/+server.ts create mode 100644 tests/nav.test.ts delete mode 100644 tests/test.ts create mode 100644 tests/wellcome-modal.test.ts diff --git a/package.json b/package.json index 1bc7560..e3bb5b3 100644 --- a/package.json +++ b/package.json @@ -64,8 +64,8 @@ "type": "module", "dependencies": { "@lucia-auth/adapter-sqlite": "^3.0.2", - "@prisma/adapter-d1": "^5.18.0", - "@prisma/client": "5.18.0", + "@prisma/adapter-d1": "^5.19.1", + "@prisma/client": "^5.19.1", "arctic": "^1.9.2", "cf-webpush": "^1.1.4", "lucia": "^3.2.0", diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 0000000..8065a12 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,23 @@ +# Nombre del proyecto +sonar.projectKey=donde-esta-tu-local +sonar.projectName=donde-esta-tu-local +sonar.projectVersion=1.0 + +# Ruta a la fuente del proyecto +sonar.sources=src + +# Extensiones de archivo a analizar +sonar.inclusions=**/*.svelte,**/*.js,**/*.ts,**/*.html + +# Configuración de TypeScript (si usas TypeScript) +sonar.ts.node.maxSpaceSize=4096 + +# Configuración de la codificación de caracteres +sonar.sourceEncoding=UTF-8 + +# Opcional: Configuración de pruebas +sonar.tests=tests +sonar.test.inclusions=**/*.spec.js,**/*.spec.ts + +# Opcional: Configuración de exclusiones +sonar.exclusions=**/*.test.js,**/*.test.ts diff --git a/src/lib/utils/gang/add-gang.test.ts b/src/lib/gang/add-gang.test.ts similarity index 100% rename from src/lib/utils/gang/add-gang.test.ts rename to src/lib/gang/add-gang.test.ts diff --git a/src/lib/utils/gang/add-gang.ts b/src/lib/gang/add-gang.ts similarity index 95% rename from src/lib/utils/gang/add-gang.ts rename to src/lib/gang/add-gang.ts index 03aab42..a39f05c 100644 --- a/src/lib/utils/gang/add-gang.ts +++ b/src/lib/gang/add-gang.ts @@ -4,7 +4,7 @@ import { NewNotificationForAdmins, type Payload, type NotificationExtraData -} from '$lib/utils/notification/notifications'; +} from '$lib/notification/notifications'; export async function AddGang( prisma: PrismaClient, diff --git a/src/lib/utils/gang/request-new-member.test.ts b/src/lib/gang/request-new-member.test.ts similarity index 100% rename from src/lib/utils/gang/request-new-member.test.ts rename to src/lib/gang/request-new-member.test.ts diff --git a/src/lib/utils/gang/request-new-member.ts b/src/lib/gang/request-new-member.ts similarity index 96% rename from src/lib/utils/gang/request-new-member.ts rename to src/lib/gang/request-new-member.ts index f88b49c..a532290 100644 --- a/src/lib/utils/gang/request-new-member.ts +++ b/src/lib/gang/request-new-member.ts @@ -4,7 +4,7 @@ import { NewNotificationForUsers, type Payload, type NotificationExtraData -} from '$lib/utils/notification/notifications'; +} from '$lib/notification/notifications'; export async function RequestNewMember(prisma: PrismaClient, gangId: number, userId: string) { const user = await prisma.user.findUnique({ diff --git a/src/lib/notification/get-user-notifications.test.ts b/src/lib/notification/get-user-notifications.test.ts new file mode 100644 index 0000000..1ff4ced --- /dev/null +++ b/src/lib/notification/get-user-notifications.test.ts @@ -0,0 +1,81 @@ +import { describe, it, expect, beforeAll, afterAll } from 'vitest'; +import { getPrismaClient } from '$lib/tests/clientForTest'; +import { GetUserNotifications, type UserNotifications } from './get-user-notifications'; + +const prisma = await getPrismaClient(); + +describe('get user notification fn', () => { + const USER_LOCAL = 'user|local'; + const GANG1 = 'Gang 1'; + let userNotifications: UserNotifications; + + beforeAll(async () => { + // Create a PEDING notification for USER_LOCAL + await prisma.notification.create({ + data: { + title: 'Test notification', + body: 'Test notification body', + status: 'PENDING', + users: { + connect: { + id: USER_LOCAL + } + } + } + }); + // Create a VALIDATED notification for USER_LOCAL + await prisma.notification.create({ + data: { + title: 'Test notification', + body: 'Test notification body', + status: 'VALIDATED', + users: { + connect: { + id: USER_LOCAL + } + } + } + }); + // Create a REFUSED notification for USER_LOCAL + await prisma.notification.create({ + data: { + title: 'Test notification', + body: 'Test notification body', + status: 'REFUSED', + users: { + connect: { + id: USER_LOCAL + } + } + } + }); + + userNotifications = await GetUserNotifications(prisma, USER_LOCAL); + }); + + afterAll(async () => { + // Remove notification from user|local + const notificationsToDelete = await prisma.notification.findMany({ + where: { users: { some: { id: USER_LOCAL } } } + }); + if (notificationsToDelete) { + for (const notificationToDelete of notificationsToDelete) { + await prisma.notification.delete({ + where: { id: notificationToDelete.id } + }); + } + } + await prisma.$disconnect(); + }); + + it('user has gang', async () => { + expect(userNotifications.user).toHaveProperty('gang'); + expect(userNotifications.user?.gang).toHaveProperty('name'); + expect(userNotifications.user?.gang.name).toBe(GANG1); + }); + + it('user has notifications', async () => { + expect(userNotifications).toHaveProperty('notifications'); + expect(userNotifications.notifications).toHaveLength(3); + }); +}); diff --git a/src/lib/utils/notification/get-user-notifications.ts b/src/lib/notification/get-user-notifications.ts similarity index 70% rename from src/lib/utils/notification/get-user-notifications.ts rename to src/lib/notification/get-user-notifications.ts index 4f35f16..06f53c0 100644 --- a/src/lib/utils/notification/get-user-notifications.ts +++ b/src/lib/notification/get-user-notifications.ts @@ -1,23 +1,19 @@ -import type { D1Database } from '@cloudflare/workers-types'; -import { initializePrisma } from '$lib/server/db'; import { logger } from '$lib/server/logger'; -import type { User, Gang, Notification, PrismaClient } from '@prisma/client'; +import type { User, Notification, PrismaClient } from '@prisma/client'; interface UserNotifications { - user?: User; + user: User | null; notifications: Notification[]; notificationsCount: number; } -export { type UserNotifications }; +export { type UserNotifications, GetUserNotifications }; -export async function getUserNotifications( - userId: string, - db: D1Database +async function GetUserNotifications( + prisma: PrismaClient, + userId: string ): Promise { - const prisma = initializePrisma(db); - const user = await prisma.user.findUnique({ where: { id: userId diff --git a/src/lib/utils/notification/notification-subscribe-user.ts b/src/lib/notification/notification-subscribe-user.ts similarity index 71% rename from src/lib/utils/notification/notification-subscribe-user.ts rename to src/lib/notification/notification-subscribe-user.ts index bfa160e..1e7ef80 100644 --- a/src/lib/utils/notification/notification-subscribe-user.ts +++ b/src/lib/notification/notification-subscribe-user.ts @@ -14,7 +14,8 @@ async function SubscribeUser( }); } if (sub && userIsLogged) { - const res = await fetch(Routes.notification_subscribe.url, { + const url = Routes.notification_subscribe.url as string; + await fetch(url, { method: 'POST', headers: { 'Content-Type': 'application/json' @@ -28,13 +29,13 @@ async function SubscribeUser( // as value for applicationServerKey in pushManager.subscribe yet // https://bugs.chromium.org/p/chromium/issues/detail?id=802280 function urlBase64ToUint8Array(base64String: string) { - var padding = '='.repeat((4 - (base64String.length % 4)) % 4); - var base64 = (base64String + padding).replace(/\-/g, '+').replace(/_/g, '/'); + const padding = '='.repeat((4 - (base64String.length % 4)) % 4); + const base64 = (base64String + padding).replace(/-/g, '+').replace(/_/g, '/'); - var rawData = window.atob(base64); - var outputArray = new Uint8Array(rawData.length); + const rawData = window.atob(base64); + const outputArray = new Uint8Array(rawData.length); - for (var i = 0; i < rawData.length; ++i) { + for (const i = 0; i < rawData.length; ++i) { outputArray[i] = rawData.charCodeAt(i); } return outputArray; diff --git a/src/lib/notification/notifications.test.ts b/src/lib/notification/notifications.test.ts new file mode 100644 index 0000000..df4f4d2 --- /dev/null +++ b/src/lib/notification/notifications.test.ts @@ -0,0 +1,66 @@ +import { describe, it, expect, beforeAll, afterAll } from 'vitest'; +import { getPrismaClient } from '$lib/tests/clientForTest'; +import { + NewNotificationForAll, + NewNotificationForAdmins, + NewNotificationForUsers, + type Payload, + type NotificationExtraData +} from './notifications'; +import type { User } from '@prisma/client'; + +const prisma = await getPrismaClient(); + +describe('new notifications', () => { + const USER_LOCAL = 'user|local'; + const USER_ADMIN = 'admin|local'; + const USER_NO_GANG = 'user|no-gang'; + + beforeAll(async () => { + const payload: Payload = { + title: 'Test notification', + body: 'Test notification body' + }; + + const extraData: NotificationExtraData = { + type: 'test-notification', + status: 'PENDING' + }; + const user_admin = (await prisma.user.findUnique({ + where: { id: USER_ADMIN } + })) as User; + const user_no_gang = (await prisma.user.findUnique({ + where: { id: USER_NO_GANG } + })) as User; + + await NewNotificationForAll(payload, extraData, USER_LOCAL, prisma); + await NewNotificationForAdmins(payload, extraData, prisma); + await NewNotificationForUsers(payload, extraData, [user_admin, user_no_gang], prisma); + }); + + afterAll(async () => { + await prisma.notification.deleteMany({ + where: { title: 'Test notification' } + }); + await prisma.$disconnect(); + }); + + it('USER_ADMIN has 3 notifications', async () => { + const userNotifications = await prisma.notification.findMany({ + where: { + title: 'Test notification', + users: { some: { id: USER_ADMIN } } + } + }); + expect(userNotifications.length).toBe(3); + }); + it('USER_NO_GANG has 2 notifications', async () => { + const userNotifications = await prisma.notification.findMany({ + where: { + title: 'Test notification', + users: { some: { id: USER_NO_GANG } } + } + }); + expect(userNotifications.length).toBe(2); + }); +}); diff --git a/src/lib/utils/notification/notifications.ts b/src/lib/notification/notifications.ts similarity index 96% rename from src/lib/utils/notification/notifications.ts rename to src/lib/notification/notifications.ts index a09bbef..9718443 100644 --- a/src/lib/utils/notification/notifications.ts +++ b/src/lib/notification/notifications.ts @@ -1,8 +1,7 @@ import { JWK } from '$env/static/private'; import { buildRequest, type PushSubscription } from 'cf-webpush'; import { logger } from '$lib/server/logger'; -import type { User, Gang, Notification } from '@prisma/client'; -import type { PrismaClient } from '@prisma/client'; +import type { User, Gang, Notification, PrismaClient } from '@prisma/client'; export interface Payload { title: string; diff --git a/src/lib/notification/validate-refuse.test.ts b/src/lib/notification/validate-refuse.test.ts new file mode 100644 index 0000000..beae2fb --- /dev/null +++ b/src/lib/notification/validate-refuse.test.ts @@ -0,0 +1,288 @@ +import { describe, it, expect, beforeAll, afterAll } from 'vitest'; +import { getPrismaClient } from '$lib/tests/clientForTest'; +import { ValidateRefuse } from './validate-refuse'; +import { AddGang } from '$lib/gang/add-gang'; +import { RequestNewMember } from '$lib/gang/request-new-member'; +import type { Gang, Notification, User } from '@prisma/client'; + +const prisma = await getPrismaClient(); + +describe('validate gang', () => { + const USER_LOCAL = 'user|local'; + const USER_ADMIN = 'admin|local'; + let gang: Gang; + let notification: Notification; + + beforeAll(async () => { + const ret = await AddGang(prisma, USER_LOCAL, 'validategang', '0', '0'); + gang = ret.data as Gang; + notification = (await prisma.notification.findFirst({ + where: { + relatedGangId: gang.id + } + })) as Notification; + const notificationId = notification?.id as number; + await ValidateRefuse(prisma, notificationId, USER_ADMIN, 'gang', 'VALIDATED', 'gang validated'); + gang = (await prisma.gang.findUnique({ + where: { + id: gang.id + } + })) as Gang; + notification = (await prisma.notification.findUnique({ + where: { + id: notificationId + } + })) as Notification; + }); + + afterAll(async () => { + await prisma.gang.delete({ + where: { + id: gang.id + } + }); + await prisma.notification.delete({ + where: { + id: notification.id + } + }); + await prisma.$disconnect(); + }); + + it('gang is validated', async () => { + expect(gang.status).toBe('VALIDATED'); + }); + it('notification is not PEDING', async () => { + expect(notification.status).not.toBe('PENDING'); + }); + it('notification reviewedByUserId is USER_ADMIN', async () => { + expect(notification.reviewedByUserId).toBe(USER_ADMIN); + }); +}); + +describe('refuse gang', () => { + const USER_LOCAL = 'user|local'; + const USER_ADMIN = 'admin|local'; + let gang: Gang; + let notification: Notification; + + beforeAll(async () => { + const ret = await AddGang(prisma, USER_LOCAL, 'refusegang', '0', '0'); + gang = ret.data as Gang; + notification = (await prisma.notification.findFirst({ + where: { + relatedGangId: gang.id + } + })) as Notification; + const notificationId = notification?.id as number; + await ValidateRefuse(prisma, notificationId, USER_ADMIN, 'gang', 'REFUSED', 'gang refused'); + gang = (await prisma.gang.findUnique({ + where: { + id: gang.id + } + })) as Gang; + notification = (await prisma.notification.findUnique({ + where: { + id: notificationId + } + })) as Notification; + }); + + afterAll(async () => { + await prisma.gang.delete({ + where: { + id: gang.id + } + }); + await prisma.notification.delete({ + where: { + id: notification.id + } + }); + await prisma.$disconnect(); + }); + + it('gang is refused', async () => { + expect(gang.status).toBe('REFUSED'); + }); + it('notification is not PEDING', async () => { + expect(notification.status).not.toBe('PENDING'); + }); + it('notification reviewedByUserId is USER_ADMIN', async () => { + expect(notification.reviewedByUserId).toBe(USER_ADMIN); + }); +}); + +describe('validate member', () => { + const USER_LOCAL = 'user|local'; + const USER_ADMIN = 'admin|local'; + const USER_NO_GANG = 'user|no-gang'; + let gang: Gang; + let notificationGang: Notification; + let notificationMember: Notification; + + beforeAll(async () => { + const ret = await AddGang(prisma, USER_LOCAL, 'validatemember', '0', '0'); + gang = ret.data as Gang; + notificationGang = (await prisma.notification.findFirst({ + where: { + relatedGangId: gang.id + } + })) as Notification; + await RequestNewMember(prisma, gang.id, USER_NO_GANG); + notificationMember = (await prisma.notification.findFirst({ + where: { + type: 'gang-member-request', + relatedGangId: gang.id, + addedByUserId: USER_NO_GANG + } + })) as Notification; + await ValidateRefuse( + prisma, + notificationMember.id, + USER_ADMIN, + 'member', + 'VALIDATED', + 'member validated' + ); + gang = (await prisma.gang.findUnique({ + where: { + id: gang.id + } + })) as Gang; + notificationMember = (await prisma.notification.findUnique({ + where: { + id: notificationMember.id + } + })) as Notification; + }); + + afterAll(async () => { + await prisma.gang.delete({ + where: { + id: gang.id + } + }); + await prisma.notification.delete({ + where: { + id: notificationGang.id + } + }); + await prisma.notification.delete({ + where: { + id: notificationMember.id + } + }); + await prisma.user.update({ + where: { + id: USER_NO_GANG + }, + data: { + gangId: null + } + }); + await prisma.$disconnect(); + }); + + it('USER_NO_GANG has gang', async () => { + const user = (await prisma.user.findUnique({ + where: { + id: USER_NO_GANG + } + })) as User; + expect(user.gangId).toBe(gang.id); + }); + it('notification is not PEDING', async () => { + expect(notificationMember.status).not.toBe('PENDING'); + }); + it('notification reviewedByUserId is USER_ADMIN', async () => { + expect(notificationMember.reviewedByUserId).toBe(USER_ADMIN); + }); +}); + +describe('refuse member', () => { + const USER_LOCAL = 'user|local'; + const USER_ADMIN = 'admin|local'; + const USER_NO_GANG = 'user|no-gang'; + let gang: Gang; + let notificationGang: Notification; + let notificationMember: Notification; + + beforeAll(async () => { + const ret = await AddGang(prisma, USER_LOCAL, 'refuse member', '0', '0'); + gang = ret.data as Gang; + notificationGang = (await prisma.notification.findFirst({ + where: { + relatedGangId: gang.id + } + })) as Notification; + await RequestNewMember(prisma, gang.id, USER_NO_GANG); + notificationMember = (await prisma.notification.findFirst({ + where: { + type: 'gang-member-request', + relatedGangId: gang.id, + addedByUserId: USER_NO_GANG + } + })) as Notification; + await ValidateRefuse( + prisma, + notificationMember.id, + USER_ADMIN, + 'member', + 'REFUSED', + 'member refused' + ); + gang = (await prisma.gang.findUnique({ + where: { + id: gang.id + } + })) as Gang; + notificationMember = (await prisma.notification.findUnique({ + where: { + id: notificationMember.id + } + })) as Notification; + }); + + afterAll(async () => { + await prisma.gang.delete({ + where: { + id: gang.id + } + }); + await prisma.notification.delete({ + where: { + id: notificationGang.id + } + }); + await prisma.notification.delete({ + where: { + id: notificationMember.id + } + }); + await prisma.user.update({ + where: { + id: USER_NO_GANG + }, + data: { + gangId: null + } + }); + await prisma.$disconnect(); + }); + + it('USER_NO_GANG has not gang', async () => { + const user = (await prisma.user.findUnique({ + where: { + id: USER_NO_GANG + } + })) as User; + expect(user.gangId).toBe(null); + }); + it('notification is not PEDING', async () => { + expect(notificationMember.status).not.toBe('PENDING'); + }); + it('notification reviewedByUserId is USER_ADMIN', async () => { + expect(notificationMember.reviewedByUserId).toBe(USER_ADMIN); + }); +}); diff --git a/src/lib/notification/validate-refuse.ts b/src/lib/notification/validate-refuse.ts new file mode 100644 index 0000000..262284f --- /dev/null +++ b/src/lib/notification/validate-refuse.ts @@ -0,0 +1,85 @@ +import { logger } from '$lib/server/logger'; + +import type { PrismaClient } from '@prisma/client'; + +export { ValidateRefuse }; + +async function ValidateRefuse( + prisma: PrismaClient, + notificationId: number, + userId: string, + type: string, + status: string, + message: string +) { + try { + let data = null; + let notification = await prisma.notification.findUnique({ + where: { + id: notificationId + } + }); + + if (notification === null && notification === undefined) { + return { success: false, error: 'Notification not found' }; + } + + const gangId = notification?.relatedGangId as number; + + if (type === 'gang') { + data = await validateRefuseGang(prisma, gangId, status); + } + if (type === 'member' && status === 'VALIDATED') { + data = await validateMember(prisma, gangId, notification?.addedByUserId as string, status); + } + + notification = await prisma.notification.update({ + where: { + id: notificationId + }, + data: { + status: status, + reviewedByUserId: userId + } + }); + logger.info(notification, 'notification ' + status); + + return { success: true, data: data, message: message }; + } catch (error) { + logger.error(error); + return { success: false, error: error }; + } +} + +async function validateRefuseGang(prisma: PrismaClient, gangId: number, status: string) { + const gang = await prisma.gang.update({ + where: { + id: gangId + }, + data: { + status: status + } + }); + logger.info(gang, 'gang ' + status); + + return gang; +} + +async function validateMember( + prisma: PrismaClient, + gangId: number, + userId: string, + status: string +) { + const user = await prisma.user.update({ + where: { + id: userId as string + }, + data: { + gangId: gangId + } + }); + logger.info(user, 'user ' + status); + + return user; +} diff --git a/src/routes/+layout.server.ts b/src/routes/+layout.server.ts index e863194..a42c5c5 100644 --- a/src/routes/+layout.server.ts +++ b/src/routes/+layout.server.ts @@ -1,11 +1,11 @@ import { ProtectedRoutes } from '$lib/routes'; import { JWK, APP_URL } from '$env/static/private'; // TODO https://github.com/sveltejs/kit/issues/8882 import { getPublicKeyFromJwk } from 'cf-webpush'; -import { getUserNotifications } from '$lib/utils/notification/get-user-notifications'; -import { logger } from '$lib/server/logger'; +import { GetUserNotifications } from '$lib/notification/get-user-notifications'; +import { initializePrisma } from '$lib/server/db'; import type { PageServerLoad, PageServerLoadEvent } from './$types'; -import type { UserNotifications } from '$lib/utils/notification/get-user-notifications'; +import type { UserNotifications } from '$lib/notification/get-user-notifications'; export const load: PageServerLoad = async (event: PageServerLoadEvent) => { let userNotification: UserNotifications = { @@ -16,8 +16,8 @@ export const load: PageServerLoad = async (event: PageServerLoadEvent) => { if (event.locals.user) { const db = event.platform!.env.DB; - logger.info(db, 'db'); - userNotification = await getUserNotifications(event.locals.user.id, db); + const prisma = initializePrisma(db); + userNotification = await GetUserNotifications(prisma, event.locals.user.id); } let path = event.route.id; diff --git a/src/routes/+layout.svelte b/src/routes/+layout.svelte index 25adde2..bfc3515 100644 --- a/src/routes/+layout.svelte +++ b/src/routes/+layout.svelte @@ -1,7 +1,7 @@