fix #2570
This commit is contained in:
parent
db36b250e3
commit
12da167794
5 changed files with 9 additions and 8 deletions
|
|
@ -115,7 +115,7 @@ export class ProfileChangeNameController extends Controller {
|
|||
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.prefixMain;
|
||||
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
|
||||
|
||||
await this.profileRepository.save(profile, { data: req });
|
||||
setLogDataDiff(req, { before, after: profile });
|
||||
|
|
@ -191,7 +191,7 @@ export class ProfileChangeNameController extends Controller {
|
|||
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.prefixMain;
|
||||
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
|
||||
await this.profileRepository.save(profile, { data: req });
|
||||
setLogDataDiff(req, { before: before_profile, after: profile });
|
||||
}
|
||||
|
|
|
|||
|
|
@ -121,7 +121,7 @@ export class ProfileChangeNameEmployeeController extends Controller {
|
|||
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.prefixMain;
|
||||
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
|
||||
await this.profileEmployeeRepo.save(profile, { data: req });
|
||||
setLogDataDiff(req, { before, after: profile });
|
||||
|
||||
|
|
@ -197,7 +197,7 @@ export class ProfileChangeNameEmployeeController extends Controller {
|
|||
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.prefixMain;
|
||||
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
|
||||
await this.profileEmployeeRepo.save(profile);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -112,7 +112,7 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
|
|||
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.prefixMain;
|
||||
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
|
||||
await this.profileEmployeeRepo.save(profile, { data: req });
|
||||
setLogDataDiff(req, { before, after: profile });
|
||||
|
||||
|
|
@ -185,7 +185,7 @@ export class ProfileChangeNameEmployeeTempController extends Controller {
|
|||
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.prefixMain;
|
||||
profile.prefix = profile.rank && profile.rank.length > 0 ? profile.rank : profile.prefix;
|
||||
await this.profileEmployeeRepo.save(profile);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -5801,7 +5801,8 @@ export class ProfileController extends Controller {
|
|||
Object.assign(record, body);
|
||||
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
|
||||
record.prefixMain = record.prefix;
|
||||
record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefixMain;
|
||||
// record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefixMain;
|
||||
record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefix;
|
||||
record.createdUserId = request.user.sub;
|
||||
record.createdFullName = request.user.name;
|
||||
record.createdAt = new Date();
|
||||
|
|
|
|||
|
|
@ -2415,7 +2415,7 @@ export class ProfileEmployeeController extends Controller {
|
|||
Object.assign(record, body);
|
||||
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
|
||||
record.prefixMain = record.prefix;
|
||||
record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefixMain;
|
||||
record.prefix = record.rank && record.rank.length > 0 ? record.rank : record.prefix;
|
||||
record.createdUserId = request.user.sub;
|
||||
record.createdFullName = request.user.name;
|
||||
record.createdAt = new Date();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue