diff --git a/.changeset/warm-ravens-wish.md b/.changeset/warm-ravens-wish.md new file mode 100644 index 0000000..2c52659 --- /dev/null +++ b/.changeset/warm-ravens-wish.md @@ -0,0 +1,5 @@ +--- +"specif-ai": patch +--- + +fix: Prevent solution creation with spaces-only input in required fields by trimming values before form submission diff --git a/ui/src/app/pages/create-solution/create-solution.component.ts b/ui/src/app/pages/create-solution/create-solution.component.ts index 90c4c76..84bbbfb 100644 --- a/ui/src/app/pages/create-solution/create-solution.component.ts +++ b/ui/src/app/pages/create-solution/create-solution.component.ts @@ -71,9 +71,18 @@ export class CreateSolutionComponent implements OnInit { createSolutionForm() { return new FormGroup({ - name: new FormControl('', Validators.required), - description: new FormControl('', Validators.required), - technicalDetails: new FormControl('', Validators.required), + name: new FormControl('', [ + Validators.required, + Validators.pattern(/\S/), + ]), + description: new FormControl('', [ + Validators.required, + Validators.pattern(/\S/), + ]), + technicalDetails: new FormControl('', [ + Validators.required, + Validators.pattern(/\S/), + ]), createReqt: new FormControl(true), id: new FormControl(uuid()), createdAt: new FormControl(new Date().toISOString()),