Fix form re-assign

This commit is contained in:
Matteo Gheza 2022-01-11 14:47:16 +01:00
parent 36ee86a167
commit 264ae7244c
1 changed files with 1 additions and 5 deletions

View File

@ -119,9 +119,7 @@ export class EditServiceComponent implements OnInit {
this.formSubmitAttempt = true;
if(this.serviceForm.valid) {
this.submittingForm = true;
let origValues = this.serviceForm.value; //very simple hack to get the original values
let values = this.serviceForm.value;
let values = Object.assign({}, this.serviceForm.value);
values.start = values.start.getTime();
values.end = values.end.getTime();
values.drivers = values.drivers.join(";");
@ -136,8 +134,6 @@ export class EditServiceComponent implements OnInit {
this.toastr.error("Errore durante l'aggiunta dell'intervento");
this.submittingForm = false;
});
this.serviceForm.value = origValues;
}
}