diff --git a/src/controllers/CommandController.ts b/src/controllers/CommandController.ts index 852ef052..4ee8c004 100644 --- a/src/controllers/CommandController.ts +++ b/src/controllers/CommandController.ts @@ -5398,6 +5398,19 @@ export class CommandController extends Controller { profile.amount = item.bodyProfile.amount ?? null; profile.amountSpecial = item.bodyProfile.amountSpecial ?? null; profile.isProbation = item.bodyProfile.isProbation; + + //เพิ่มใหม่จากรับโอน + profile.prefix = item.bodyProfile.prefix && item.bodyProfile.prefix != "" ?item.bodyProfile.prefix : profile.prefix; + profile.firstName = item.bodyProfile.firstName && item.bodyProfile.firstName != "" ? item.bodyProfile.firstName : profile.firstName; + profile.lastName = item.bodyProfile.lastName && item.bodyProfile.lastName != "" ? item.bodyProfile.lastName : profile.lastName; + profile.birthDate = item.bodyProfile.birthDate ? item.bodyProfile.birthDate : profile.birthDate; + profile.gender = item.bodyProfile.gender && item.bodyProfile.gender != "" ? item.bodyProfile.gender : profile.gender; + profile.relationship = item.bodyProfile.relationship && item.bodyProfile.relationship != "" ? item.bodyProfile.relationship : profile.relationship; + profile.religion = item.bodyProfile.religion && item.bodyProfile.religion != "" ? item.bodyProfile.religion : profile.religion; + profile.nationality = item.bodyProfile.nationality && item.bodyProfile.nationality != "" ? item.bodyProfile.nationality : profile.nationality; + profile.bloodGroup = item.bodyProfile.bloodGroup && item.bodyProfile.bloodGroup != "" ? item.bodyProfile.bloodGroup : profile.bloodGroup; + profile.phone = item.bodyProfile.phone && item.bodyProfile.phone != "" ? item.bodyProfile.phone : profile.phone; + await this.profileRepository.save(profile); setLogDataDiff(req, { before, after: profile }); }