Skip to content

Commit

Permalink
Prevent solution creation with spaces-only input (#53)
Browse files Browse the repository at this point in the history
  • Loading branch information
neeraj-presidio authored Feb 27, 2025
1 parent 7e9dc0c commit 9cd6428
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
5 changes: 5 additions & 0 deletions .changeset/warm-ravens-wish.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"specif-ai": patch
---

fix: Prevent solution creation with spaces-only input in required fields by trimming values before form submission
15 changes: 12 additions & 3 deletions ui/src/app/pages/create-solution/create-solution.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()),
Expand Down

0 comments on commit 9cd6428

Please sign in to comment.