diff --git a/src/services/PositionService.ts b/src/services/PositionService.ts index cbf842bb..a2703c36 100644 --- a/src/services/PositionService.ts +++ b/src/services/PositionService.ts @@ -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;