update เมื่อลบคนครองต้องไม่ปั้มชื่อลงประวัติคนครอง
This commit is contained in:
parent
332a96efb3
commit
8888d2f27c
2 changed files with 9 additions and 4 deletions
|
|
@ -11,6 +11,7 @@ import { RequestWithUser } from "../middlewares/user";
|
|||
export async function CreatePosMasterHistoryOfficer(
|
||||
posMasterId: string,
|
||||
request: RequestWithUser | null,
|
||||
type?: string | null,
|
||||
): Promise<boolean> {
|
||||
try {
|
||||
await AppDataSource.transaction(async (manager) => {
|
||||
|
|
@ -42,9 +43,11 @@ export async function CreatePosMasterHistoryOfficer(
|
|||
? pm.positions.find((p) => p.positionIsSelected === true) ?? null
|
||||
: null;
|
||||
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;
|
||||
if(!type || type != "DELETE"){
|
||||
h.prefix = pm.current_holder?.prefix || _null;
|
||||
h.firstName = pm.current_holder?.firstName || _null;
|
||||
h.lastName = pm.current_holder?.lastName || _null;
|
||||
}
|
||||
h.posMasterNoPrefix = pm.posMasterNoPrefix ?? _null;
|
||||
h.posMasterNo = pm.posMasterNo ?? _null;
|
||||
h.posMasterNoSuffix = pm.posMasterNoSuffix ?? _null;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue