add update time
This commit is contained in:
parent
ad4efc2b47
commit
a2292d6048
57 changed files with 257 additions and 98 deletions
|
|
@ -2388,6 +2388,12 @@ export class ProfileController extends Controller {
|
|||
|
||||
if (!record) throw new HttpError(HttpStatus.NOT_FOUND, "ไม่พบข้อมูลโปรไฟล์นี้");
|
||||
|
||||
Object.assign(record, body);
|
||||
record.lastUpdateUserId = request.user.sub;
|
||||
record.lastUpdateFullName = request.user.name;
|
||||
record.lastUpdatedAt = new Date();
|
||||
record.dateRetire = calculateRetireDate(record.birthDate);
|
||||
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
|
||||
await this.profileHistoryRepo.save(
|
||||
Object.assign(new ProfileHistory(), {
|
||||
...record,
|
||||
|
|
@ -2395,13 +2401,6 @@ export class ProfileController extends Controller {
|
|||
id: undefined,
|
||||
}),
|
||||
);
|
||||
|
||||
Object.assign(record, body);
|
||||
record.lastUpdateUserId = request.user.sub;
|
||||
record.lastUpdateFullName = request.user.name;
|
||||
record.lastUpdatedAt = new Date();
|
||||
record.dateRetire = calculateRetireDate(record.birthDate);
|
||||
record.dateRetireLaw = calculateRetireLaw(record.birthDate);
|
||||
await this.profileRepo.save(record);
|
||||
|
||||
if (record != null && record.keycloak != null) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue