From 93bf906eec4f0998a354e89e15acb86a083889e7 Mon Sep 17 00:00:00 2001 From: julian Date: Thu, 28 May 2026 00:45:04 +0000 Subject: [PATCH] fix(api): adiciona guard prisma CLS no DashboardService Co-Authored-By: Claude Sonnet 4.6 --- apps/api/src/app/dashboard/dashboard.service.ts | 2 ++ 1 file changed, 2 insertions(+) diff --git a/apps/api/src/app/dashboard/dashboard.service.ts b/apps/api/src/app/dashboard/dashboard.service.ts index ed65c48..bee638d 100644 --- a/apps/api/src/app/dashboard/dashboard.service.ts +++ b/apps/api/src/app/dashboard/dashboard.service.ts @@ -10,6 +10,7 @@ export class DashboardService { async repDashboard(userId: string): Promise { const prisma = this.cls.get('prisma'); + if (!prisma) throw new Error('prisma não disponível no CLS'); const now = new Date(); const year = now.getFullYear(); const month = now.getMonth() + 1; @@ -109,6 +110,7 @@ export class DashboardService { async supervisorDashboard(): Promise { const prisma = this.cls.get('prisma'); + if (!prisma) throw new Error('prisma não disponível no CLS'); const now = new Date(); // Fila de aprovações — mais antigos primeiro