diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 7bac242a..59d75312 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -6594,8 +6594,8 @@ export class CommandController extends Controller { profile.amountSpecial = item.bodyProfile.amountSpecial ?? null; profile.isProbation = item.bodyProfile.isProbation; //เพิ่มใหม่จากรับโอน - profile.rank = item?.bodyProfile?.rank ?? null; - profile.prefix = item?.bodyProfile?.rank ?? item?.bodyProfile?.prefix ?? null; + profile.rank = item?.bodyProfile?.rank || null; + profile.prefix = item?.bodyProfile?.rank || item?.bodyProfile?.prefix || null; profile.prefixMain = item?.bodyProfile?.prefix ?? null; profile.firstName = item.bodyProfile.firstName ?? null; profile.lastName = item.bodyProfile.lastName ?? null; @@ -6658,8 +6658,8 @@ export class CommandController extends Controller { profile.amount = item.bodyProfile.amount ?? null; profile.amountSpecial = item.bodyProfile.amountSpecial ?? null; profile.isProbation = item.bodyProfile.isProbation; - profile.rank = item?.bodyProfile?.rank ?? null; - profile.prefix = item?.bodyProfile?.rank ?? item?.bodyProfile?.prefix ?? null; + profile.rank = item?.bodyProfile?.rank || null; + profile.prefix = item?.bodyProfile?.rank || item?.bodyProfile?.prefix || null; profile.prefixMain = item?.bodyProfile?.prefix ?? null; profile.firstName = item.bodyProfile.firstName ?? null; profile.lastName = item.bodyProfile.lastName ?? null; @@ -6717,8 +6717,8 @@ export class CommandController extends Controller { profile.lastUpdateFullName = req.user.name; profile.lastUpdatedAt = new Date(); //เพิ่มใหม่จากรับโอน - profile.rank = item?.bodyProfile?.rank ?? null; - profile.prefix = item?.bodyProfile?.rank ?? item?.bodyProfile?.prefix ?? null; + profile.rank = item?.bodyProfile?.rank || null; + profile.prefix = item?.bodyProfile?.rank || item?.bodyProfile?.prefix || null; profile.prefixMain = item?.bodyProfile?.prefix ?? null; profile.firstName = item.bodyProfile.firstName && item.bodyProfile.firstName != ""