From f5ba594a840efcea401b14a108bb59a5f8ace26b Mon Sep 17 00:00:00 2001 From: Kittapath Date: Tue, 27 Feb 2024 12:34:44 +0700 Subject: [PATCH] =?UTF-8?q?=E0=B8=AB=E0=B8=B2=E0=B8=AA=E0=B8=B1=E0=B8=87?= =?UTF-8?q?=E0=B8=81=E0=B8=B1=E0=B8=94=E0=B8=95=E0=B8=B1=E0=B8=A7=E0=B9=80?= =?UTF-8?q?=E0=B8=AD=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/SalaryPeriodController.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/controllers/SalaryPeriodController.ts b/src/controllers/SalaryPeriodController.ts index d96a195..ca47924 100644 --- a/src/controllers/SalaryPeriodController.ts +++ b/src/controllers/SalaryPeriodController.ts @@ -38,8 +38,8 @@ export class SalaryPeriodController extends Controller { * @summary SLR_030 - รอบล่าสุด #29 * */ - @Get("latest") - async GetGroupSalaryPeriodLatest() { + @Get("latest/{id}") + async GetGroupSalaryPeriodLatest(@Path() id: string) { //xxxx รอบเงินเดือนล่าสุดยังไม่แน่ใจเอาจากรอบไหน //xxxx หาสังกัดคนนั้น // const dateNow = new Date(); @@ -56,8 +56,8 @@ export class SalaryPeriodController extends Controller { } const data = { - group1id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP1")?.id, - group2id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP2")?.id, + group1id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP1" && x.rootId == id)?.id, + group2id: salaryPeriod.salaryOrgs.find((x) => x.group == "GROUP2" && x.rootId == id)?.id, effectiveDate: salaryPeriod.effectiveDate, period: salaryPeriod.period, };