test throw report api
This commit is contained in:
parent
c31af516b3
commit
f026ffde89
1 changed files with 4 additions and 0 deletions
|
|
@ -12,6 +12,7 @@ import { KpiCapacity } from "../entities/kpiCapacity";
|
|||
import { KpiPlan } from "../entities/kpiPlan";
|
||||
import { KpiRole } from "../entities/kpiRole";
|
||||
import CallAPI from "../interfaces/call-api";
|
||||
import { throws } from "assert";
|
||||
@Route("api/v1/kpi/report")
|
||||
@Tags("Report")
|
||||
@Security("bearerAuth")
|
||||
|
|
@ -775,6 +776,9 @@ export class ReportController extends Controller {
|
|||
relations: ["kpiPeriod"],
|
||||
where: { id: In(profileEvaluationIds.map((evaluation) => evaluation.id)) },
|
||||
});
|
||||
if(!profileEvaluation || profileEvaluation.length === 0){
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลรายงานการประเมินผลฯ ระดับบุคคลของบุคคลนี้");
|
||||
}
|
||||
|
||||
const combinedData: KPIData = profileEvaluation.reduce(
|
||||
(acc: KPIData, x) => {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue