This commit is contained in:
harid 2026-06-17 17:14:52 +07:00
parent 12da167794
commit e7eeb3e34d
3 changed files with 12 additions and 12 deletions

View file

@ -114,8 +114,8 @@ export class ProfileChangeNameController extends Controller {
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
profile.prefixMain = body.prefix ?? profile.prefix;
profile.prefix = body.rank && body.rank.length > 0 ? body.rank : body.prefix ?? profile.prefix;
await this.profileRepository.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
@ -190,8 +190,8 @@ export class ProfileChangeNameController extends Controller {
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
profile.prefixMain = body.prefix ?? profile.prefix;
profile.prefix = body.rank && body.rank.length > 0 ? body.rank : body.prefix ?? profile.prefix;
await this.profileRepository.save(profile, { data: req });
setLogDataDiff(req, { before: before_profile, after: profile });
}

View file

@ -120,8 +120,8 @@ export class ProfileChangeNameEmployeeController extends Controller {
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
profile.prefixMain = body.prefix ?? profile.prefix;
profile.prefix = body.rank && body.rank.length > 0 ? body.rank : body.prefix ?? profile.prefix;
await this.profileEmployeeRepo.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
@ -196,8 +196,8 @@ export class ProfileChangeNameEmployeeController extends Controller {
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
profile.prefixMain = body.prefix ?? profile.prefix;
profile.prefix = body.rank && body.rank.length > 0 ? body.rank : body.prefix ?? profile.prefix;
await this.profileEmployeeRepo.save(profile);
}

View file

@ -111,8 +111,8 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
profile.prefixMain = body.prefix ?? profile.prefix;
profile.prefix = body.rank && body.rank.length > 0 ? body.rank : body.prefix ?? profile.prefix;
await this.profileEmployeeRepo.save(profile, { data: req });
setLogDataDiff(req, { before, after: profile });
@ -184,8 +184,8 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
// profile.prefix = body.prefix ?? profile.prefix; //old
profile.rank = body.rank ?? profile.rank;
// profile.prefixMain = profile.rank ?? profile.prefix; // old
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
profile.prefixMain = body.prefix ?? profile.prefix;
profile.prefix = body.rank && body.rank.length > 0 ? body.rank : body.prefix ?? profile.prefix;
await this.profileEmployeeRepo.save(profile);
}