diff --git a/src/controllers/KpiCapacityController.ts b/src/controllers/KpiCapacityController.ts index d6629f1..2cf41fc 100644 --- a/src/controllers/KpiCapacityController.ts +++ b/src/controllers/KpiCapacityController.ts @@ -216,12 +216,16 @@ export class kpiCapacityController extends Controller { @Query("positionName") positionName: string ) { - const position = await this.positionRepository.findOne({ + let position = await this.positionRepository.findOne({ where: { name: Like(`%${positionName}%`) }, relations: ["kpiLink.kpiCapacitys"] }) - if(position == null){ - throw new HttpError(HttpStatusCode.NOT_FOUND, `ไม่พบข้อมูลตำแหน่งนี้: ${positionName}`); + + if (position == null) { + position = await this.positionRepository.findOne({ + where: { name: "นักจัดการงานทั่วไป" }, + relations: ["kpiLink.kpiCapacitys"] + }) } let positionLinkId: any