feat(validation): Implement form validation and error handling utilities

- Add validation rules for form fields with XSS protection
- Create API error handler to parse and manage server validation errors
- Integrate validation rules into contact and inquiries forms
- Enhance error handling with user feedback for form submissions
- Introduce unit tests for validation and error handling functionalities
This commit is contained in:
AmirReza Jamali
2026-02-08 13:35:07 +03:30
parent 5fc6469752
commit 7b6cd4d965
9 changed files with 4834 additions and 108 deletions
+6 -1
View File
@@ -5,7 +5,9 @@
"scripts": {
"dev": "next dev --turbopack",
"build": "next build --turbopack",
"start": "next start"
"start": "next start",
"test": "jest",
"test:watch": "jest --watch"
},
"dependencies": {
"@hcaptcha/react-hcaptcha": "^1.16.0",
@@ -24,10 +26,13 @@
},
"devDependencies": {
"@tailwindcss/postcss": "^4",
"@types/jest": "^30.0.0",
"@types/node": "^20",
"@types/react": "^19",
"@types/react-dom": "^19",
"jest": "^30.2.0",
"tailwindcss": "^4",
"ts-jest": "^29.4.6",
"typescript": "^5"
}
}