diff --git a/src/controllers/WorkflowController.ts b/src/controllers/WorkflowController.ts index f02aaf4b..3bd6fe19 100644 --- a/src/controllers/WorkflowController.ts +++ b/src/controllers/WorkflowController.ts @@ -1045,11 +1045,11 @@ export class WorkflowController extends Controller { const processedData = body.isAct ? data : data.map((x: any) => ({ - ...x, - posExecutiveNameOrg: - (x.posExecutiveName ?? "") + - (x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""), - })); + ...x, + posExecutiveNameOrg: + (x.posExecutiveName ?? "") + + (x.orgChild4 ?? x.orgChild3 ?? x.orgChild2 ?? x.orgChild1 ?? x.orgRoot ?? ""), + })); return new HttpSuccess({ data: processedData, total }); } @@ -1363,7 +1363,7 @@ export class WorkflowController extends Controller { keycloak: req.user.sub, }, }); - if (!profile) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลผู้ใช้งาน"); + if (!profile) throw new HttpError(HttpStatus.UNAUTHORIZED, "ไม่พบข้อมูลผู้ใช้งาน"); const profileOfficer = await this.workflowRepo.findOne({ where: { @@ -1372,7 +1372,7 @@ export class WorkflowController extends Controller { // sysName: body.sysName, }, }); - if (!profileOfficer) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลสิทธิ์"); + if (!profileOfficer) throw new HttpError(HttpStatus.FORBIDDEN, "ไม่พบข้อมูลสิทธิ์"); return new HttpSuccess(); }