Skip to content

Commit 9cd6428

Browse files
Prevent solution creation with spaces-only input (#53)
1 parent 7e9dc0c commit 9cd6428

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

.changeset/warm-ravens-wish.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"specif-ai": patch
3+
---
4+
5+
fix: Prevent solution creation with spaces-only input in required fields by trimming values before form submission

ui/src/app/pages/create-solution/create-solution.component.ts

+12-3
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,18 @@ export class CreateSolutionComponent implements OnInit {
7171

7272
createSolutionForm() {
7373
return new FormGroup({
74-
name: new FormControl('', Validators.required),
75-
description: new FormControl('', Validators.required),
76-
technicalDetails: new FormControl('', Validators.required),
74+
name: new FormControl('', [
75+
Validators.required,
76+
Validators.pattern(/\S/),
77+
]),
78+
description: new FormControl('', [
79+
Validators.required,
80+
Validators.pattern(/\S/),
81+
]),
82+
technicalDetails: new FormControl('', [
83+
Validators.required,
84+
Validators.pattern(/\S/),
85+
]),
7786
createReqt: new FormControl(true),
7887
id: new FormControl(uuid()),
7988
createdAt: new FormControl(new Date().toISOString()),

0 commit comments

Comments
 (0)