diff --git a/src/controllers/KpiPeriodController.ts b/src/controllers/KpiPeriodController.ts index 5f5622a..36b3491 100644 --- a/src/controllers/KpiPeriodController.ts +++ b/src/controllers/KpiPeriodController.ts @@ -220,36 +220,6 @@ export class kpiPeriodController extends Controller { return new HttpSuccess({ data: kpiPeriod, total }); } - /** - * API รอบการประเมินผลการปฏิบัติหน้าที่ราชการ - * @param id Guid, *Id รอบการประเมินผลการปฏิบัติหน้าที่ราชการ - */ - @Get("{id}") - @Example({ - durationKPI: "string", //รอบเดือนที่สร้าง - startDate: "datetime", //วันเริ่มต้น - endDate: "datetime", //วันสิ้นสุด - }) - async GetKpiPeriodById(@Path() id: string) { - const kpiPeriod = await this.kpiPeriodRepository.findOne({ - where: { id: id }, - select: ["year", "durationKPI", "startDate", "endDate", "isActive"], - }); - if (!kpiPeriod) { - throw new HttpError( - HttpStatusCode.NOT_FOUND, - "ไม่พบข้อมูลรอบการประเมินผลการปฏิบัติหน้าที่ราชการนี้", - ); - } - return new HttpSuccess(kpiPeriod); - } - - /** - * API list รอบการประเมินผลการปฏิบัติหน้าที่ราชการ (ADMIN) - * @param page - * @param pageSize - * @param keyword - */ @Get("admin") async listKpiPeriodAdmin( @Request() request: RequestWithUser, @@ -274,6 +244,30 @@ export class kpiPeriodController extends Controller { return new HttpSuccess({ data: kpiPeriod, total }); } + /** + * API รอบการประเมินผลการปฏิบัติหน้าที่ราชการ + * @param id Guid, *Id รอบการประเมินผลการปฏิบัติหน้าที่ราชการ + */ + @Get("{id}") + @Example({ + durationKPI: "string", //รอบเดือนที่สร้าง + startDate: "datetime", //วันเริ่มต้น + endDate: "datetime", //วันสิ้นสุด + }) + async GetKpiPeriodById(@Path() id: string) { + const kpiPeriod = await this.kpiPeriodRepository.findOne({ + where: { id: id }, + select: ["year", "durationKPI", "startDate", "endDate", "isActive"], + }); + if (!kpiPeriod) { + throw new HttpError( + HttpStatusCode.NOT_FOUND, + "ไม่พบข้อมูลรอบการประเมินผลการปฏิบัติหน้าที่ราชการนี้", + ); + } + return new HttpSuccess(kpiPeriod); + } + /** * API list รอบการประเมินผลการปฏิบัติหน้าที่ราชการ (USER) * @param page