fix(api): adiciona guard prisma CLS no DashboardService
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -10,6 +10,7 @@ export class DashboardService {
|
|||||||
|
|
||||||
async repDashboard(userId: string): Promise<RepDashboard> {
|
async repDashboard(userId: string): Promise<RepDashboard> {
|
||||||
const prisma = this.cls.get('prisma');
|
const prisma = this.cls.get('prisma');
|
||||||
|
if (!prisma) throw new Error('prisma não disponível no CLS');
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
const year = now.getFullYear();
|
const year = now.getFullYear();
|
||||||
const month = now.getMonth() + 1;
|
const month = now.getMonth() + 1;
|
||||||
@@ -109,6 +110,7 @@ export class DashboardService {
|
|||||||
|
|
||||||
async supervisorDashboard(): Promise<SupervisorDashboard> {
|
async supervisorDashboard(): Promise<SupervisorDashboard> {
|
||||||
const prisma = this.cls.get('prisma');
|
const prisma = this.cls.get('prisma');
|
||||||
|
if (!prisma) throw new Error('prisma não disponível no CLS');
|
||||||
const now = new Date();
|
const now = new Date();
|
||||||
|
|
||||||
// Fila de aprovações — mais antigos primeiro
|
// Fila de aprovações — mais antigos primeiro
|
||||||
|
|||||||
Reference in New Issue
Block a user