sort ตำแหน่งลูกจ้าง
This commit is contained in:
parent
2972d6ef5e
commit
222a2a5b6b
4 changed files with 71 additions and 22 deletions
|
|
@ -58,7 +58,6 @@ export class EmployeePosLevelController extends Controller {
|
|||
|
||||
const EmpPosType = await this.employeePosTypeRepository.findOne({
|
||||
where: { id: requestBody.posTypeId },
|
||||
|
||||
});
|
||||
if (!EmpPosType) {
|
||||
throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลกลุ่มงานลูกจ้างประจำนี้");
|
||||
|
|
@ -112,12 +111,12 @@ export class EmployeePosLevelController extends Controller {
|
|||
|
||||
const chkEmpPosLevel = await this.employeePosLevelRepository.findOne({
|
||||
where: {
|
||||
id: Not(id),
|
||||
posLevelName: requestBody.posLevelName,
|
||||
posTypeId: requestBody.posTypeId,
|
||||
id: Not(id),
|
||||
posLevelName: requestBody.posLevelName,
|
||||
posTypeId: requestBody.posTypeId,
|
||||
},
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
if (chkEmpPosLevel) {
|
||||
throw new HttpError(
|
||||
HttpStatusCode.NOT_FOUND,
|
||||
|
|
@ -198,6 +197,7 @@ export class EmployeePosLevelController extends Controller {
|
|||
const empPosLevel = await this.employeePosLevelRepository.find({
|
||||
relations: ["posType"],
|
||||
select: ["id", "posLevelName", "posLevelRank", "posLevelAuthority"],
|
||||
order: { posLevelRank: "ASC" },
|
||||
});
|
||||
const mapEmpPosLevel = empPosLevel.map((item) => ({
|
||||
id: item.id,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue