fix #1594
All checks were successful
Build & Deploy on Dev / build (push) Successful in 1m17s

This commit is contained in:
harid 2026-06-15 11:52:20 +07:00
parent ed6ab06b52
commit 8236caf458
3 changed files with 25 additions and 13 deletions

View file

@ -111,10 +111,12 @@ export class ProfileChangeNameController extends Controller {
setLogDataDiff(req, { before, after: history });
profile.firstName = body.firstName ?? profile.firstName;
profile.lastName = body.lastName ?? profile.lastName;
profile.prefix = body.prefix ?? profile.prefix;
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
profile.prefixMain = profile.rank ?? profile.prefix;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefixMain;
await this.profileRepository.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
@ -185,9 +187,11 @@ export class ProfileChangeNameController extends Controller {
if (profile && chkLastRecord.id === record.id) {
profile.firstName = body.firstName ?? profile.firstName;
profile.lastName = body.lastName ?? profile.lastName;
profile.prefix = body.prefix ?? profile.prefix;
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
profile.prefixMain = profile.rank ?? profile.prefix;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefixMain;
await this.profileRepository.save(profile, { data: req });
setLogDataDiff(req, { before: before_profile, after: profile });
}

View file

@ -117,9 +117,11 @@ export class ProfileChangeNameEmployeeController extends Controller {
profile.firstName = body.firstName ?? profile.firstName;
profile.lastName = body.lastName ?? profile.lastName;
profile.prefix = body.prefix ?? profile.prefix;
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
profile.prefixMain = profile.rank ?? profile.prefix;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefixMain;
await this.profileEmployeeRepo.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
@ -191,9 +193,11 @@ export class ProfileChangeNameEmployeeController extends Controller {
if (profile && chkLastRecord.id === record.id) {
profile.firstName = body.firstName ?? profile.firstName;
profile.lastName = body.lastName ?? profile.lastName;
profile.prefix = body.prefix ?? profile.prefix;
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
profile.prefixMain = profile.rank ?? profile.prefix;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefixMain;
await this.profileEmployeeRepo.save(profile);
}

View file

@ -108,9 +108,11 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
profile.firstName = body.firstName ?? profile.firstName;
profile.lastName = body.lastName ?? profile.lastName;
profile.prefix = body.prefix ?? profile.prefix;
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
profile.prefixMain = profile.rank ?? profile.prefix;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefixMain;
await this.profileEmployeeRepo.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
@ -179,9 +181,11 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
if (profile && chkLastRecord.id === record.id) {
profile.firstName = body.firstName ?? profile.firstName;
profile.lastName = body.lastName ?? profile.lastName;
profile.prefix = body.prefix ?? profile.prefix;
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
profile.prefixMain = profile.rank ?? profile.prefix;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefixMain;
await this.profileEmployeeRepo.save(profile);
}