From 4a879693377ac20c36a5bb22d13840608c796d52 Mon Sep 17 00:00:00 2001 From: mamoss <> Date: Mon, 24 Mar 2025 22:43:43 +0700 Subject: [PATCH] sort commandcode --- src/controllers/CommandCodeController.ts | 6 ++++-- src/controllers/ImportDataController.ts | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/controllers/CommandCodeController.ts b/src/controllers/CommandCodeController.ts index b04bb4e2..dffd0f20 100644 --- a/src/controllers/CommandCodeController.ts +++ b/src/controllers/CommandCodeController.ts @@ -43,13 +43,15 @@ export class CommandCodeController extends Controller { select: [ "id", "name", + "caption", + "order", "code", "createdAt", "lastUpdatedAt", "createdFullName", "lastUpdateFullName", ], - order: { id: "ASC" }, + order: { order: "ASC" }, }); return new HttpSuccess(_commandCode); } @@ -65,7 +67,7 @@ export class CommandCodeController extends Controller { async GetById(@Path() id: string) { const _commandCode = await this.commandCodeRepository.findOne({ where: { id }, - select: ["id", "name", "code"], + select: ["id", "name", "code", "order", "caption"], }); if (!_commandCode) { throw new HttpError(HttpStatusCode.NOT_FOUND, "ไม่พบข้อมูลเชื่อมโยงคำสั่งนี้"); diff --git a/src/controllers/ImportDataController.ts b/src/controllers/ImportDataController.ts index cd55cca6..b0ff4187 100644 --- a/src/controllers/ImportDataController.ts +++ b/src/controllers/ImportDataController.ts @@ -2629,7 +2629,7 @@ export class ImportDataController extends Controller { @Post("update-profileSalary") async UpdateProfileSalary(@Request() request: { user: Record }) { let rowCount = 0; - const profileSalarys: any = await this.salaryRepo.find(); + const profileSalarys: any = await this.salaryRepo.find({ where: { refId: IsNull() } }); for await (const _item of profileSalarys) { const OFFICER = await this.OFFICERRepo.findOne({