From 7920832c5c62a976b9766257bf47194cec5804a6 Mon Sep 17 00:00:00 2001 From: harid Date: Fri, 12 Jun 2026 18:02:54 +0700 Subject: [PATCH] revert --- src/controllers/ProfileChangeNameController.ts | 9 ++------- src/controllers/ProfileController.ts | 6 +----- 2 files changed, 3 insertions(+), 12 deletions(-) diff --git a/src/controllers/ProfileChangeNameController.ts b/src/controllers/ProfileChangeNameController.ts index 18bd4922..3f61301f 100644 --- a/src/controllers/ProfileChangeNameController.ts +++ b/src/controllers/ProfileChangeNameController.ts @@ -111,14 +111,9 @@ export class ProfileChangeNameController extends Controller { setLogDataDiff(req, { before, after: history }); profile.firstName = body.firstName ?? profile.firstName; profile.lastName = body.lastName ?? profile.lastName; - //old - // profile.prefix = body.prefix ?? profile.prefix; - // profile.rank = body.rank ?? profile.rank; - // profile.prefixMain = profile.rank ?? profile.prefix; - //new - profile.prefixMain = profile.prefix; - profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix; + profile.prefix = body.prefix ?? profile.prefix; profile.rank = body.rank ?? profile.rank; + profile.prefixMain = profile.rank ?? profile.prefix; await this.profileRepository.save(profile, { data: req }); setLogDataDiff(req, { before, after: profile }); diff --git a/src/controllers/ProfileController.ts b/src/controllers/ProfileController.ts index c2925193..42b322d3 100644 --- a/src/controllers/ProfileController.ts +++ b/src/controllers/ProfileController.ts @@ -5800,12 +5800,8 @@ export class ProfileController extends Controller { Object.assign(record, body); record.dateRetireLaw = calculateRetireLaw(record.birthDate); - //old - // record.prefixMain = record.prefix; - // record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefixMain; - //new record.prefixMain = record.prefix; - record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefix; + record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefixMain; record.createdUserId = request.user.sub; record.createdFullName = request.user.name; record.createdAt = new Date();