fixed: #2562
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m3s

This commit is contained in:
Warunee Tamkoo 2026-06-11 23:51:15 +07:00
parent 1e69cf6bb7
commit 3a4ac309b9

View file

@ -9123,8 +9123,10 @@ export class OrganizationController extends Controller {
org: draftPosMaster ? getOrgFullName(draftPosMaster as PosMaster) ?? _null : _null, org: draftPosMaster ? getOrgFullName(draftPosMaster as PosMaster) ?? _null : _null,
}); });
} }
if (nextHolderId != null && draftPos.positionIsSelected) {
// ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ // ถ้าไม่ใช่ตำแหน่งนั่งทับ (isSit = false) ถึงจะอัพเดทตำแหน่งในทะเบียนประวัติ
if (nextHolderId != null && draftPos.positionIsSelected && !draftPosMaster?.isSit) { if (!draftPosMaster?.isSit) {
const existing = profileUpdates.get(nextHolderId) || {}; const existing = profileUpdates.get(nextHolderId) || {};
existing.position = draftPos.positionName; existing.position = draftPos.positionName;
existing.posTypeId = draftPos.posTypeId; existing.posTypeId = draftPos.posTypeId;
@ -9134,6 +9136,9 @@ export class OrganizationController extends Controller {
existing.positionArea = draftPos.positionArea ?? null; existing.positionArea = draftPos.positionArea ?? null;
existing.positionExecutiveField = draftPos.positionExecutiveField ?? null; existing.positionExecutiveField = draftPos.positionExecutiveField ?? null;
profileUpdates.set(nextHolderId, existing); profileUpdates.set(nextHolderId, existing);
}
// ยังบันทึกประวัติคนครอง
if (draftPosMaster && draftPosMaster.ancestorDNA) { if (draftPosMaster && draftPosMaster.ancestorDNA) {
// Find the selected position from draft positions // Find the selected position from draft positions
const selectedPos = const selectedPos =