From 5908cac8fafc4b84e76df9935fcc2578d97a8c77 Mon Sep 17 00:00:00 2001 From: Kittapath Date: Mon, 18 Mar 2024 15:24:28 +0700 Subject: [PATCH] no message --- src/controllers/EmployeePositionController.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/controllers/EmployeePositionController.ts b/src/controllers/EmployeePositionController.ts index cdfe1b66..547ec5ae 100644 --- a/src/controllers/EmployeePositionController.ts +++ b/src/controllers/EmployeePositionController.ts @@ -269,6 +269,7 @@ export class EmployeePositionController extends Controller { findData = await this.employeePosDictRepository.find({ where: { posDictName: Like(`%${keyword}%`) }, relations: ["posType", "posLevel"], + order: { posLevel: { posLevelName: "ASC" } }, }); break; @@ -280,6 +281,7 @@ export class EmployeePositionController extends Controller { findData = await this.employeePosDictRepository.find({ where: { posTypeId: In(findEmpTypes.map((x) => x.id)) }, relations: ["posType", "posLevel"], + order: { posLevel: { posLevelName: "ASC" } }, }); break; @@ -291,11 +293,13 @@ export class EmployeePositionController extends Controller { findData = await this.employeePosDictRepository.find({ where: { posLevelId: In(findEmpLevels.map((x) => x.id)) }, relations: ["posType", "posLevel"], + order: { posLevel: { posLevelName: "ASC" } }, }); } else { //กรณีเลือกค้นหาจาก"ระดับชั้นงาน" แต่กรอกไม่ใช่ number ให้ปล่อยมาหมดเลย findData = await this.employeePosDictRepository.find({ relations: ["posType", "posLevel"], + order: { posLevel: { posLevelName: "ASC" } }, }); } break; @@ -303,6 +307,7 @@ export class EmployeePositionController extends Controller { default: findData = await this.employeePosDictRepository.find({ relations: ["posType", "posLevel"], + order: { posLevel: { posLevelName: "ASC" } }, }); break; }