fix bug capacity
This commit is contained in:
parent
22f7e01ea8
commit
c9c4d86f6a
1 changed files with 7 additions and 3 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue