บัค ทะเบียนประวัติ #812 (3,4)

This commit is contained in:
AdisakKanthawilang 2024-11-28 17:17:47 +07:00
parent b492cfa220
commit 40c6cc32a7
2 changed files with 7 additions and 7 deletions

View file

@ -1807,7 +1807,7 @@ export class ProfileController extends Controller {
const profile = Object.assign(new Profile(), body);
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank ?? profile.prefixMain;
profile.prefix = profile.rank && profile.rank.length > 0?profile.rank:profile.prefixMain;
profile.isProbation = false;
profile.isLeave = false;
profile.createdUserId = request.user.sub;
@ -1880,7 +1880,7 @@ export class ProfileController extends Controller {
const profile: Profile = Object.assign(new Profile(), body);
const _null: any = null;
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank ?? profile.prefixMain;
profile.prefix = profile.rank && profile.rank.length > 0?profile.rank:profile.prefixMain;
profile.dateRetire = body.birthDate == null ? _null : calculateRetireDate(body.birthDate);
profile.dateRetireLaw = body.birthDate == null ? _null : calculateRetireLaw(body.birthDate);
profile.createdUserId = request.user.sub;
@ -1949,7 +1949,7 @@ export class ProfileController extends Controller {
}
const profile: Profile = Object.assign(new Profile(), body);
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank ?? profile.prefixMain;
profile.prefix = profile.rank && profile.rank.length > 0?profile.rank:profile.prefixMain;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
@ -3521,7 +3521,7 @@ export class ProfileController extends Controller {
Object.assign(record, body);
record.prefixMain = record.prefix;
record.prefix = record.rank ?? record.prefixMain;
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();
@ -7898,7 +7898,7 @@ export class ProfileController extends Controller {
}
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank ?? profile.prefixMain;
profile.prefix = profile.rank && profile.rank.length > 0?profile.rank:profile.prefixMain;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;

View file

@ -830,7 +830,7 @@ export class ProfileEmployeeController extends Controller {
const profile = Object.assign(new ProfileEmployee(), body);
profile.prefixMain = profile.prefix;
profile.prefix = profile.rank ?? profile.prefixMain;
profile.prefix = profile.rank && profile.rank.length > 0?profile.rank:profile.prefixMain;
profile.createdUserId = request.user.sub;
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
@ -927,7 +927,7 @@ export class ProfileEmployeeController extends Controller {
Object.assign(record, body);
record.prefixMain = record.prefix;
record.prefix = record.rank ?? record.prefixMain;
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();