fix Noti แจ้งเตือนผิด #2417
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m6s

This commit is contained in:
harid 2026-04-09 17:20:24 +07:00
parent 15ac8d0514
commit 6a1ca6b867
4 changed files with 9 additions and 4 deletions

View file

@ -369,7 +369,8 @@ export class DevelopmentRequestController extends Controller {
posLevelName: profile.posLevel.posLevelName,
posTypeName: profile.posType.posTypeName,
fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`,
isDeputy: orgRoot?.isDeputy ?? false
isDeputy: orgRoot?.isDeputy ?? false,
orgRootId: orgRoot?.id ?? null
})
.catch((error) => {
console.error("Error calling API:", error);

View file

@ -363,7 +363,8 @@ export class ProfileEditController extends Controller {
posLevelName: profile.posLevel.posLevelName,
posTypeName: profile.posType.posTypeName,
fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`,
isDeputy: orgRoot?.isDeputy ?? false
isDeputy: orgRoot?.isDeputy ?? false,
orgRootId: orgRoot?.id ?? null
})
.catch((error) => {
console.error("Error calling API:", error);

View file

@ -363,7 +363,8 @@ export class ProfileEditEmployeeController extends Controller {
posLevelName: "EMP",
posTypeName: "EMP",
fullName: `${profile.prefix}${profile.firstName} ${profile.lastName}`,
isDeputy: orgRoot?.isDeputy ?? false
isDeputy: orgRoot?.isDeputy ?? false,
orgRootId: orgRoot?.id ?? null
})
.catch((error) => {
console.error("Error calling API:", error);

View file

@ -54,6 +54,7 @@ export class WorkflowController extends Controller {
posTypeName: string;
fullName?: string | null;
isDeputy?: boolean | null;
orgRootId?: string | null;
},
) {
// ขั้นที่ 1: ทำการค้นหา profile และ metaWorkflow แบบ parallel
@ -203,9 +204,10 @@ export class WorkflowController extends Controller {
posMasterAssigns: { assignId: body.sysName },
orgRevision: { orgRevisionIsDraft: false, orgRevisionIsCurrent: true },
current_holderId: Not(IsNull()), // เพิ่มเงื่อนไขนี้เพื่อกรองเฉพาะที่มี current_holder
...(body.orgRootId && { orgRootId: body.orgRootId }), // กรองเฉพาะที่อยู่ในสำนักเดียวกัน (ถ้าส่งมา)
},
relations: ["orgChild1"],
select: ["current_holderId", "orgChild1"], // เลือกเฉพาะ field ที่จำเป็น
// select: ["current_holderId", "orgChild1"], // เลือกเฉพาะ field ที่จำเป็น
});
// สร้าง StateOperatorUsers สำหรับ officers