diff --git a/src/app/form/form.component.ts b/src/app/form/form.component.ts index 74de67430c068ef2655c49c2cc97b07188758a69..d01cd10412367176d75118d72e2c5f3789074080 100644 --- a/src/app/form/form.component.ts +++ b/src/app/form/form.component.ts @@ -309,7 +309,7 @@ export class FormComponent implements OnInit { Validators.required, Validators.pattern(CustomRegExp.NO_NULL_NUMBER), ]), - freeWorkShop: new FormControl(structure.freeWorkShop), + freeWorkShop: new FormControl(structure.freeWorkShop, [Validators.required]), }); return form; } @@ -888,6 +888,9 @@ export class FormComponent implements OnInit { } public validateForm(): void { + if (this.getStructureControl('freeWorkShop').value === null) { + this.getStructureControl('freeWorkShop').setValue(false); + } if (this.structureForm.valid && this.hoursForm.valid) { let structure: Structure = this.structureForm.value; structure.hours = this.hoursForm.value;