This commit is contained in:
AdisakKanthawilang 2025-09-04 09:54:53 +07:00
parent 16622b4768
commit acbd0604f8

View file

@ -33,14 +33,14 @@ export async function CreatePosMasterHistoryOfficer(
});
if (!pm) return false;
if (!pm.ancestorDNA) return false;
// if (!pm.ancestorDNA) return false; // ทำให้สร้างตำแหน่งใหม่โครงสร้างปัจจุบัน(ไม่มีancestorDNA)แล้วไม่ปั๊มประวัติ
const _null: any = null;
const h = new PosMasterHistory();
const selectedPosition =
pm.positions.length > 0
? pm.positions.find((p) => p.positionIsSelected === true) ?? null
? pm.positions.find((p) => p.positionIsSelected === true) ?? null
: null;
h.ancestorDNA = pm.ancestorDNA;
h.ancestorDNA = pm.ancestorDNA? pm.ancestorDNA : _null;
h.prefix = pm.current_holder?.prefix || _null;
h.firstName = pm.current_holder?.firstName || _null;
h.lastName = pm.current_holder?.lastName || _null;