This commit is contained in:
parent
8232c6696e
commit
7920832c5c
2 changed files with 3 additions and 12 deletions
|
|
@ -111,14 +111,9 @@ export class ProfileChangeNameController extends Controller {
|
||||||
setLogDataDiff(req, { before, after: history });
|
setLogDataDiff(req, { before, after: history });
|
||||||
profile.firstName = body.firstName ?? profile.firstName;
|
profile.firstName = body.firstName ?? profile.firstName;
|
||||||
profile.lastName = body.lastName ?? profile.lastName;
|
profile.lastName = body.lastName ?? profile.lastName;
|
||||||
//old
|
profile.prefix = body.prefix ?? profile.prefix;
|
||||||
// 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.rank = body.rank ?? profile.rank;
|
profile.rank = body.rank ?? profile.rank;
|
||||||
|
profile.prefixMain = profile.rank ?? profile.prefix;
|
||||||
|
|
||||||
await this.profileRepository.save(profile, { data: req });
|
await this.profileRepository.save(profile, { data: req });
|
||||||
setLogDataDiff(req, { before, after: profile });
|
setLogDataDiff(req, { before, after: profile });
|
||||||
|
|
|
||||||
|
|
@ -5800,12 +5800,8 @@ export class ProfileController extends Controller {
|
||||||
|
|
||||||
Object.assign(record, body);
|
Object.assign(record, body);
|
||||||
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
|
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.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.createdUserId = request.user.sub;
|
||||||
record.createdFullName = request.user.name;
|
record.createdFullName = request.user.name;
|
||||||
record.createdAt = new Date();
|
record.createdAt = new Date();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue