From c3e785122b7dd88728d854b8c8c25d474628fc48 Mon Sep 17 00:00:00 2001 From: Alexis Lahouze Date: Sun, 13 Aug 2017 14:17:05 +0200 Subject: [PATCH] Use copy instead of new instance. --- src/accounts/accountEditModal.component.ts | 2 +- src/scheduler/scheduleEditModal.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/accounts/accountEditModal.component.ts b/src/accounts/accountEditModal.component.ts index 5def8c2..ae859bd 100644 --- a/src/accounts/accountEditModal.component.ts +++ b/src/accounts/accountEditModal.component.ts @@ -44,7 +44,7 @@ export class AccountEditModalComponent { submit(): void { let formModel = this.accountForm.form.value; - let account = new Account(); + let account = Object.assign({}, this.account); account.id = this.account.id; account.name = formModel.name; diff --git a/src/scheduler/scheduleEditModal.component.ts b/src/scheduler/scheduleEditModal.component.ts index 02ef752..d099c6c 100644 --- a/src/scheduler/scheduleEditModal.component.ts +++ b/src/scheduler/scheduleEditModal.component.ts @@ -46,7 +46,7 @@ export class ScheduleEditModalComponent { submit(): void { let formModel = this.scheduleForm.form.value; - let schedule = new Schedule(); + let schedule = Object.assign({}, this.schedule); schedule.id = this.schedule.id; schedule.start_date = formModel.startDate;