From 31ecf81af53640d3c046581831ffed7e3af7bd7d Mon Sep 17 00:00:00 2001 From: core Date: Tue, 20 Aug 2024 17:47:42 -0400 Subject: [PATCH] hotfix: add forgotten facilityId on two pages 9 minutes --- src/routes/(hq)/[id]/training/+page.server.ts | 4 ++-- src/routes/(hq)/[id]/training/plans/+page.server.ts | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/routes/(hq)/[id]/training/+page.server.ts b/src/routes/(hq)/[id]/training/+page.server.ts index fcc2606..29e81d1 100644 --- a/src/routes/(hq)/[id]/training/+page.server.ts +++ b/src/routes/(hq)/[id]/training/+page.server.ts @@ -41,7 +41,7 @@ export const load: PageServerLoad = async ({ parent, params }) => { }), sessions: reversed( await prisma.trainingSession.findMany({ - where: { studentId: user.id }, + where: { studentId: user.id, facilityId: params.id }, include: { plan: true, mentor: true, @@ -50,7 +50,7 @@ export const load: PageServerLoad = async ({ parent, params }) => { ), mentorSessions: reversed( await prisma.trainingSession.findMany({ - where: { mentorId: user.id }, + where: { mentorId: user.id, facilityId: params.id }, include: { plan: true, student: true, diff --git a/src/routes/(hq)/[id]/training/plans/+page.server.ts b/src/routes/(hq)/[id]/training/plans/+page.server.ts index fbab7a4..1ae6073 100644 --- a/src/routes/(hq)/[id]/training/plans/+page.server.ts +++ b/src/routes/(hq)/[id]/training/plans/+page.server.ts @@ -25,6 +25,9 @@ export const load: PageServerLoad = async ({ params, cookies }) => { return { plans: await prisma.trainingPlan.findMany({ + where: { + facilityId: params.id + }, include: { TrainingPlanRegistration: true, },