diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index 3bd6fe19..01b53dd3 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -150,16 +150,19 @@ export class WorkflowController extends Controller { if (body.sysName == "SYS_TRANSFER_REQ") { if (metaStateOp.operator == "PersonnelOfficer" && correspondingState?.order == 1) { return; - } - else if (metaStateOp.operator == "Officer" && [1, 2].includes(correspondingState?.order as number)) { - metaStateOp.operator = "PersonnelOfficer" + } else if ( + metaStateOp.operator == "Officer" && + [1, 2].includes(correspondingState?.order as number) + ) { + metaStateOp.operator = "PersonnelOfficer"; } } // Task #2208 กรณีขอแก้ไขข้อมูลทะเบียนประวัติ และ IDP และคนขออยู่ในสำนักปลัดกรุงเทพมหานคร - if (metaStateOp.operator == "Officer" && - (["REGISTRY_PROFILE", "REGISTRY_PROFILE_EMP", "REGISTRY_IDP"].includes(body.sysName)) + if ( + metaStateOp.operator == "Officer" && + ["REGISTRY_PROFILE", "REGISTRY_PROFILE_EMP", "REGISTRY_IDP"].includes(body.sysName) ) { - metaStateOp.operator = "PersonnelOfficer" + metaStateOp.operator = "PersonnelOfficer"; } } if (correspondingState) { @@ -1042,14 +1045,12 @@ export class WorkflowController extends Controller { ]); // 8. ปรับ response mapping (ถ้าจำเป็น) - const processedData = body.isAct - ? data - : data.map((x: any) => ({ - ...x, - posExecutiveNameOrg: - (x.posExecutiveName ?? "") + - (x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""), - })); + const processedData = data.map((x: any) => ({ + ...x, + posExecutiveNameOrg: + (x.posExecutiveName ?? "") + + (x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""), + })); return new HttpSuccess({ data: processedData, total }); }