diff --git a/src/controllers/KpiUserEvaluationController.ts b/src/controllers/KpiUserEvaluationController.ts index 0545a5a..2284d03 100644 --- a/src/controllers/KpiUserEvaluationController.ts +++ b/src/controllers/KpiUserEvaluationController.ts @@ -114,7 +114,7 @@ export class KpiUserEvaluationController extends Controller { ? requestBody.status.trim().toUpperCase() == "NEW" ? `kpiUserEvaluation.evaluationStatus LIKE CASE WHEN kpiUserEvaluation.evaluatorId = "${profileId}" THEN "NEW_EVALUATOR" WHEN kpiUserEvaluation.commanderId = "${profileId}" THEN "NEW_COMMANDER" WHEN kpiUserEvaluation.commanderHighId = "${profileId}" THEN "NEW_COMMANDER_HIGH" ELSE "${requestBody.status.trim().toUpperCase()}" END` : requestBody.status.trim().toUpperCase() == "EVALUATING_EVALUATOR" || - requestBody.status.trim().toUpperCase() == "EVALUATING" + requestBody.status.trim().toUpperCase() == "EVALUATING" ? "kpiUserEvaluation.evaluationStatus LIKE :status" : requestBody.status.trim().toUpperCase() == "SUMMARY" ? "kpiUserEvaluation.evaluationStatus LIKE :status" @@ -125,8 +125,8 @@ export class KpiUserEvaluationController extends Controller { requestBody.status == null || requestBody.status == undefined ? null : requestBody.status.trim().toUpperCase() == "EVALUATING" || - requestBody.status.trim().toUpperCase() == "EVALUATING_EVALUATOR" || - requestBody.status.trim().toUpperCase() == "SUMMARY" + requestBody.status.trim().toUpperCase() == "EVALUATING_EVALUATOR" || + requestBody.status.trim().toUpperCase() == "SUMMARY" ? requestBody.status.trim().toUpperCase() == "SUMMARY" ? `%${requestBody.status.trim().toUpperCase()}%` : `%EVALUATING%` @@ -254,7 +254,7 @@ export class KpiUserEvaluationController extends Controller { .then((x) => { _data = x; }) - .catch((x) => {}); + .catch((x) => { }); let query = await AppDataSource.getRepository(KpiUserEvaluation) .createQueryBuilder("kpiUserEvaluation") .andWhere( @@ -474,7 +474,7 @@ export class KpiUserEvaluationController extends Controller { .then((x) => { _data = x; }) - .catch((x) => {}); + .catch((x) => { }); let conditionFullName = "CONCAT(kpiUserEvaluation.prefix, kpiUserEvaluation.firstName, ' ', kpiUserEvaluation.lastName) LIKE :keyword"; let query = await AppDataSource.getRepository(KpiUserEvaluation) @@ -663,9 +663,9 @@ export class KpiUserEvaluationController extends Controller { @Request() request: RequestWithUser, ) { if ( - requestBody.evaluatorId == requestBody.commanderId || - requestBody.commanderId == requestBody.commanderHighId || - requestBody.evaluatorId == requestBody.commanderHighId + requestBody.evaluatorId != null && requestBody.evaluatorId == requestBody.commanderId || + requestBody.evaluatorId != null && requestBody.evaluatorId == requestBody.commanderHighId || + requestBody.commanderId != null && requestBody.commanderId == requestBody.commanderHighId ) { throw new HttpError( HttpStatusCode.NOT_FOUND, @@ -1138,8 +1138,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); } const before = structuredClone(kpiUserEvaluation); kpiUserEvaluation.evaluationReqEdit = requestBody.status.trim().toUpperCase(); @@ -1221,8 +1221,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); let _null: any = null; kpiUserEvaluation.reasonReject = _null; kpiUserEvaluation.actorReject = _null; @@ -1243,8 +1243,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); } const before = structuredClone(kpiUserEvaluation); let _null: any = null; @@ -1297,7 +1297,7 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(async () => {}) + .then(async () => { }) .catch((error) => { console.error("Error details:", error.response.data); }); @@ -1367,8 +1367,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); const before = structuredClone(kpiUserEvaluation); let _null: any = null; kpiUserEvaluation.evaluationStatus = "EVALUATING_EVALUATOR"; @@ -1718,8 +1718,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); item.evaluationStatus = "NEW_COMMANDER"; } } @@ -1743,8 +1743,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); item.evaluationStatus = "NEW_COMMANDER_HIGH"; } } @@ -1768,8 +1768,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); item.evaluationStatus = "APPROVE"; } } @@ -1863,8 +1863,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); } } } else if (role == "COMMANDER") { @@ -1889,8 +1889,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); } } } else { @@ -1911,8 +1911,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); } } else { item.evaluationReqEdit = requestBody.status.trim().toUpperCase(); @@ -2147,8 +2147,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); kpiUserEvaluation.evaluationStatus = "COMPLETE"; } else { await new CallAPI() @@ -2166,8 +2166,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); kpiUserEvaluation.evaluationStatus = "SUMMARY_COMMANDER"; } const before = structuredClone(kpiUserEvaluation); @@ -2229,8 +2229,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); kpiUserEvaluation.evaluationStatus = "COMPLETE"; } else { await new CallAPI() @@ -2248,8 +2248,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); kpiUserEvaluation.evaluationStatus = "SUMMARY_COMMANDER_HIGH"; } const before = structuredClone(kpiUserEvaluation); @@ -2308,8 +2308,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); kpiUserEvaluation.evaluationStatus = "COMPLETE"; } else { await new CallAPI() @@ -2327,8 +2327,8 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(() => {}) - .catch(() => {}); + .then(() => { }) + .catch(() => { }); kpiUserEvaluation.evaluationStatus = "COMPLETE"; } const before = structuredClone(kpiUserEvaluation); @@ -2384,7 +2384,7 @@ export class KpiUserEvaluationController extends Controller { pointSum: kpiUserEvaluation.summaryPoint, profileId: kpiUserEvaluation.profileId, }) - .then(async () => {}) + .then(async () => { }) .catch((error) => { console.error("Error details:", error.response.data); }); @@ -2411,7 +2411,7 @@ export class KpiUserEvaluationController extends Controller { kpiUserDevelopment.point != null ? kpiUserDevelopment.point.toString() : null, developmentProjects: kpiUserDevelopment.developmentProjects.map((x) => x.name), }) - .then(async () => {}) + .then(async () => { }) .catch((error) => { console.error("Error details:", error.response.data); }); @@ -2427,7 +2427,7 @@ export class KpiUserEvaluationController extends Controller { isSendInbox: true, isSendNotification: true, }) - .then(async () => {}) + .then(async () => { }) .catch((error) => { console.error("Error details:", error.response.data); });