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