diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 3f163a0..370dc38 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -564,7 +564,6 @@ export class ReportController extends Controller { return data; }); - } formattedData = { @@ -632,7 +631,7 @@ export class ReportController extends Controller { const profileEvaluationIds = await AppDataSource.getRepository(KpiUserEvaluation) .createQueryBuilder("kpiUserEvaluation") .leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod") - // .where("kpiUserEvaluation.profileId = :profileId", { profileId: requestBody.profileId }) + .where("kpiUserEvaluation.profileId = :profileId", { profileId: requestBody.profileId }) .andWhere("kpiPeriod.year BETWEEN :startYear AND :endYear", { startYear: yearNow - 4, endYear: yearNow, @@ -640,7 +639,7 @@ export class ReportController extends Controller { .groupBy("kpiUserEvaluation.kpiPeriodId") .select("MIN(kpiUserEvaluation.id) as id") .getRawMany(); - if (profileEvaluationIds.length > 0) { + // if (profileEvaluationIds.length > 0) { const profileEvaluation = await this.kpiUserEvaluationRepository.find({ relations: ["kpiPeriod"], where: { id: In(profileEvaluationIds.map((evaluation) => evaluation.id)) }, @@ -799,7 +798,7 @@ export class ReportController extends Controller { }, ); formattedData = combinedData; - } + // } } } if (requestBody.type == "KPI6") { @@ -845,7 +844,7 @@ export class ReportController extends Controller { const profileEvaluationIds = await AppDataSource.getRepository(KpiUserEvaluation) .createQueryBuilder("kpiUserEvaluation") .leftJoinAndSelect("kpiUserEvaluation.kpiPeriod", "kpiPeriod") - // .where("kpiUserEvaluation.profileId = :profileId", { profileId: requestBody.profileId }) + .where("kpiUserEvaluation.profileId = :profileId", { profileId: requestBody.profileId }) .andWhere("kpiPeriod.year BETWEEN :startYear AND :endYear", { startYear: yearNow - 2, endYear: yearNow, @@ -853,7 +852,7 @@ export class ReportController extends Controller { .groupBy("kpiUserEvaluation.kpiPeriodId") .select("MIN(kpiUserEvaluation.id) as id") .getRawMany(); - if (profileEvaluationIds.length > 0) { + // if (profileEvaluationIds.length > 0) { const profileEvaluation = await this.kpiUserEvaluationRepository.find({ relations: ["kpiPeriod"], where: { id: In(profileEvaluationIds.map((evaluation) => evaluation.id)) }, @@ -961,7 +960,7 @@ export class ReportController extends Controller { }, ); formattedData = combinedData; - } + // } } } if (requestBody.type == "KPI7") {