@@ -66,6 +67,7 @@ const ProjectForm: React.FC
diff --git a/frontend/src/component/project/Project/hooks/useProjectForm.ts b/frontend/src/component/project/Project/hooks/useProjectForm.ts
index 8ffee53f3a..f735168d28 100644
--- a/frontend/src/component/project/Project/hooks/useProjectForm.ts
+++ b/frontend/src/component/project/Project/hooks/useProjectForm.ts
@@ -33,7 +33,7 @@ const useProjectForm = (
};
const NAME_EXISTS_ERROR = 'Error: A project with this id already exists.';
- const validateIdUniqueness = async () => {
+ const validateProjectId = async () => {
if (projectId.length === 0) {
setErrors(prev => ({ ...prev, id: 'Id can not be empty.' }));
return false;
@@ -47,19 +47,16 @@ const useProjectForm = (
...prev,
id: 'A project with this id already exists',
}));
+ } else {
+ setErrors(prev => ({
+ ...prev,
+ id: e.toString(),
+ }));
}
return false;
}
};
- const validateProjectId = () => {
- if (projectId.length === 0) {
- setErrors(prev => ({ ...prev, id: 'id can not be empty.' }));
- return false;
- }
- return true;
- };
-
const validateName = () => {
if (projectName.length === 0) {
setErrors(prev => ({ ...prev, name: 'Name can not be empty.' }));
@@ -83,7 +80,6 @@ const useProjectForm = (
getProjectPayload,
validateName,
validateProjectId,
- validateIdUniqueness,
clearErrors,
errors,
};