no message

This commit is contained in:
harid 2026-06-12 17:53:23 +07:00
parent d84ec4f55d
commit aeae391034
3 changed files with 13 additions and 4 deletions

View file

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

View file

@ -111,9 +111,15 @@ 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;
//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.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,8 +5800,12 @@ 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.createdUserId = request.user.sub;
record.createdFullName = request.user.name;
record.createdAt = new Date();