From 0d059f24ea0f0b1382a422c4f4d6cce311a7369c Mon Sep 17 00:00:00 2001 From: Adisak Date: Fri, 17 Oct 2025 17:38:54 +0700 Subject: [PATCH] =?UTF-8?q?update=20validate=20=E0=B8=AA=E0=B8=B4=E0=B8=97?= =?UTF-8?q?=E0=B8=98=E0=B8=B4=E0=B9=8C=E0=B8=88=E0=B8=B1=E0=B8=94=E0=B8=81?= =?UTF-8?q?=E0=B8=B2=E0=B8=A3=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87=E0=B8=AA?= =?UTF-8?q?=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B9=83=E0=B8=99=E0=B9=80?= =?UTF-8?q?=E0=B8=A1=E0=B8=99=E0=B8=B9=E0=B9=82=E0=B8=84=E0=B8=A3=E0=B8=87?= =?UTF-8?q?=E0=B8=AA=E0=B8=A3=E0=B9=89=E0=B8=B2=E0=B8=87=E0=B8=AD=E0=B8=B1?= =?UTF-8?q?=E0=B8=95=E0=B8=95=E0=B8=A3=E0=B8=B2=E0=B8=81=E0=B8=B3=E0=B8=A5?= =?UTF-8?q?=E0=B8=B1=E0=B8=87?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/controllers/OrganizationController.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/controllers/OrganizationController.ts b/src/controllers/OrganizationController.ts index 71156c48..e163ade8 100644 --- a/src/controllers/OrganizationController.ts +++ b/src/controllers/OrganizationController.ts @@ -1988,7 +1988,11 @@ export class OrganizationController extends Controller { ?.posMasterAssigns.find((x) => x.assignId === "SYS_ORG"); if (orgRevision.orgRevisionIsDraft && !orgRevision.orgRevisionIsCurrent && !attrOwnership) { - _data.root = profile.permissionProfiles.map((x) => x.orgRootId); + if(Array.isArray(profile.permissionProfiles) && profile.permissionProfiles.length > 0){ + _data.root = profile.permissionProfiles.map((x) => x.orgRootId); + }else{ + return new HttpSuccess({ remark: "", data: [] }); + } } // กำหนดการเข้าถึงข้อมูลตามสถานะและสิทธิ์ const isCurrentActive = !orgRevision.orgRevisionIsDraft && orgRevision.orgRevisionIsCurrent;