fix entity and store dateRetire

This commit is contained in:
AdisakKanthawilang 2024-05-15 18:06:28 +07:00
parent 0df3191fcc
commit cf3c3feba2
4 changed files with 11 additions and 1 deletions

View file

@ -114,6 +114,8 @@ export class ProfileEmployeeController extends Controller {
profile.createdFullName = request.user.name;
profile.lastUpdateUserId = request.user.sub;
profile.lastUpdateFullName = request.user.name;
profile.dateRetire = calculateRetireDate(profile.birthDate);
profile.dateRetireLaw = calculateRetireDate(profile.birthDate);
await this.profileRepo.save(profile);
return new HttpSuccess();
@ -202,6 +204,8 @@ export class ProfileEmployeeController extends Controller {
Object.assign(record, body);
record.lastUpdateUserId = request.user.sub;
record.lastUpdateFullName = request.user.name;
record.dateRetire = calculateRetireDate(record.birthDate);
record.dateRetireLaw = calculateRetireDate(record.birthDate);
await this.profileRepo.save(record);