From fddb78380e4ec05af144b815fd8b3ff7e43965c5 Mon Sep 17 00:00:00 2001 From: Thomas Heartman Date: Mon, 13 May 2024 10:49:05 +0200 Subject: [PATCH] fix: make the project submission work from the project creation modal (#7040) It seems the code that was copied was copied from before we changed the validation logic, so it wouldn't submit. This fixes that to remove any ID validation in the new form. --- .../CreateProjectDialog/CreateProjectDialog.tsx | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/frontend/src/component/project/Project/CreateProject/CreateProjectDialog/CreateProjectDialog.tsx b/frontend/src/component/project/Project/CreateProject/CreateProjectDialog/CreateProjectDialog.tsx index f4816eb343..2b1f15fe69 100644 --- a/frontend/src/component/project/Project/CreateProject/CreateProjectDialog/CreateProjectDialog.tsx +++ b/frontend/src/component/project/Project/CreateProject/CreateProjectDialog/CreateProjectDialog.tsx @@ -87,14 +87,15 @@ export const CreateProjectDialogue = ({ e.preventDefault(); clearErrors(); const validName = validateName(); - const validId = await validateProjectId(); - if (validName && validId) { - const payload = getCreateProjectPayload(); + if (validName) { + const payload = getCreateProjectPayload({ + omitId: true, + }); try { - await createProject(payload); + const createdProject = await createProject(payload); refetchUser(); - navigate(`/projects/${projectId}`, { replace: true }); + navigate(`/projects/${createdProject.id}`, { replace: true }); setToastData({ title: 'Project created', text: 'Now you can add toggles to this project', @@ -113,7 +114,6 @@ export const CreateProjectDialogue = ({ } } }; - return (