diff --git a/src/controllers/ProfileAbilityController.ts b/src/controllers/ProfileAbilityController.ts index 69c0a0fa..df6fdd0c 100644 --- a/src/controllers/ProfileAbilityController.ts +++ b/src/controllers/ProfileAbilityController.ts @@ -156,8 +156,8 @@ export class ProfileAbilityController extends Controller { const history = new ProfileAbilityHistory(); + Object.assign(history, { ...record, id: undefined }); Object.assign(record, requestBody); - Object.assign(history, { ...requestBody, id: undefined }); history.profileAbilityId = abilityId; history.lastUpdateFullName = req.user.name; diff --git a/src/controllers/ProfileAssessmentsController.ts b/src/controllers/ProfileAssessmentsController.ts index 73ca5f05..992770c8 100644 --- a/src/controllers/ProfileAssessmentsController.ts +++ b/src/controllers/ProfileAssessmentsController.ts @@ -169,8 +169,8 @@ export class ProfileAssessmentsController extends Controller { const history = new ProfileAssessmentHistory(); + Object.assign(history, { ...record, id: undefined }); Object.assign(record, requestBody); - Object.assign(history, { ...requestBody, id: undefined }); history.profileAssessmentId = assessmentId; history.lastUpdateFullName = req.user.name; diff --git a/src/controllers/ProfileEducationsController.ts b/src/controllers/ProfileEducationsController.ts index 0a31993e..dffba92d 100644 --- a/src/controllers/ProfileEducationsController.ts +++ b/src/controllers/ProfileEducationsController.ts @@ -201,8 +201,8 @@ export class ProfileEducationsController extends Controller { const history = new ProfileEducationHistory(); + Object.assign(history, { ...record, id: undefined }); Object.assign(record, requestBody); - Object.assign(history, { ...requestBody, id: undefined }); history.profileEducationId = educationId; history.lastUpdateFullName = req.user.name; diff --git a/src/controllers/ProfileInformationController.ts b/src/controllers/ProfileInformationController.ts index 892eb4e0..816bb0c9 100644 --- a/src/controllers/ProfileInformationController.ts +++ b/src/controllers/ProfileInformationController.ts @@ -157,8 +157,8 @@ export class ProfileInformationController extends Controller { console.log(requestBody); + Object.assign(history, { ...record, id: undefined }); Object.assign(record, requestBody); - Object.assign(history, { ...requestBody, id: undefined }); history.profileInformationId = informationId; history.lastUpdateFullName = req.user.name;