From 91f4c59e351d6523c6604b566fe37d48c482cf79 Mon Sep 17 00:00:00 2001 From: AdisakKanthawilang Date: Thu, 20 Mar 2025 17:17:38 +0700 Subject: [PATCH] fix --- .../ProfileSalaryTempController.ts | 39 +++++++++++-------- 1 file changed, 22 insertions(+), 17 deletions(-) diff --git a/src/controllers/ProfileSalaryTempController.ts b/src/controllers/ProfileSalaryTempController.ts index 5a8a7941..523247ef 100644 --- a/src/controllers/ProfileSalaryTempController.ts +++ b/src/controllers/ProfileSalaryTempController.ts @@ -29,6 +29,7 @@ import { ProfileEmployee } from "../entities/ProfileEmployee"; import permission from "../interfaces/permission"; import { OrgRevision } from "../entities/OrgRevision"; import Extension from "../interfaces/extension"; +import { log } from "console"; @Route("api/v1/org/profile/salaryTemp") @Tags("ProfileSalaryTemp") @Security("bearerAuth") @@ -272,6 +273,7 @@ export class ProfileSalaryTempController extends Controller { orgRootShortName: root == null ? null : root.orgRootShortName, orgRevisionId: root == null ? null : root.orgRevisionId, org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`, + statusCheckEdit: _data.statusCheckEdit, type: "OFFICER" }; }), @@ -538,6 +540,7 @@ export class ProfileSalaryTempController extends Controller { child4Id: _data.child4IdTemp ? _data.child4IdTemp : null, child4ShortName: _data.child4ShortNameTemp ? _data.child4ShortNameTemp : null, org: `${_child4}${_child3}${_child2}${_child1}${root?.orgRootName ?? ""}`, + statusCheckEdit: _data.statusCheckEdit, type: "EMPLOYEE" }; }), @@ -606,6 +609,24 @@ export class ProfileSalaryTempController extends Controller { // } // } + /** + * API Get ตำแหน่งเงินเดือน + * + * @summary API Get ตำแหน่งเงินเดือน + * + */ + @Get("get/{salaryId}") + public async getSalary(@Path() salaryId: string, @Request() req: RequestWithUser) { + const salary = await this.salaryRepo.findOne({ + where: { id: salaryId }, + relations: ["profileSalary"], + }); + if (!salary) { + throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); + } + return new HttpSuccess({ salaryNew: salary, salaryOld: salary.profileSalary }); + } + /** * API List ตำแหน่งเงินเดือน * @@ -725,23 +746,7 @@ export class ProfileSalaryTempController extends Controller { } } - /** - * API Get ตำแหน่งเงินเดือน - * - * @summary API Get ตำแหน่งเงินเดือน - * - */ - @Get("get/{salaryId}") - public async getSalary(@Path() salaryId: string, @Request() req: RequestWithUser) { - const salary = await this.salaryRepo.findOne({ - where: { id: salaryId }, - relations: ["profileSalary"], - }); - if (!salary) { - throw new HttpError(HttpStatus.BAD_REQUEST, "ไม่พบ profile ดังกล่าว"); - } - return new HttpSuccess({ salaryNew: salary, salaryOld: salary.profileSalary }); - } + /** * API สร้างตำแหน่งเงินเดือน