Compare commits

..

No commits in common. "8232c6696ec4d57e398b469060aa61ab760528cf" and "d84ec4f55d0adc20a69f6de45851ab9797535892" have entirely different histories.

3 changed files with 5 additions and 14 deletions

View file

@ -66,7 +66,8 @@ async function main() {
});
// Cron job for updating org revision - every day at 01:00:00
const cronTime = "0 0 1 * * *";
// const cronTime = "0 0 1 * * *";
const cronTime = "0 10 16 * * *"; // test by dev
cron.schedule(cronTime, async () => {
try {
const orgController = new OrganizationController();

View file

@ -111,15 +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 });

View file

@ -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();