diff --git a/pephub/routers/api/v1/project.py b/pephub/routers/api/v1/project.py index 1a2a6dc8..628eecad 100644 --- a/pephub/routers/api/v1/project.py +++ b/pephub/routers/api/v1/project.py @@ -729,7 +729,7 @@ async def create_view_of_the_project( _LOGGER.error(f"Could not create view. Error: {e}") raise HTTPException( status_code=409, - detail="Could not create view", + detail="This view already exists in the project.", ) return JSONResponse( content={ diff --git a/web/src/components/modals/add-view-options.tsx b/web/src/components/modals/add-view-options.tsx index c075064b..c58baaff 100644 --- a/web/src/components/modals/add-view-options.tsx +++ b/web/src/components/modals/add-view-options.tsx @@ -81,7 +81,11 @@ export const ViewOptionsModal = (props: Props) => { noFail: false, }; - viewMutations.addViewMutation.mutate(createViewRequest); + viewMutations.addViewMutation.mutate(createViewRequest, { + onSuccess: () => { + onHide(); + }, + }); resetForm({}, { keepValues: false }); }; @@ -95,13 +99,13 @@ export const ViewOptionsModal = (props: Props) => { {filteredSamples ? (
+
Save the current filtered sample table state as a view by providing a name (required) and description (optional) for the view.