diff --git a/backend/apps/system/api/workspace.py b/backend/apps/system/api/workspace.py index 0d795289..8cd05ac8 100644 --- a/backend/apps/system/api/workspace.py +++ b/backend/apps/system/api/workspace.py @@ -205,6 +205,8 @@ async def get_one(session: SessionDep, trans: Trans, id: int): @router.delete("/{id}") async def single_delete(session: SessionDep, id: int): + if id == 1: + raise HTTPException(f"Can not delete default workspace") db_model = session.get(WorkspaceModel, id) if not db_model: raise HTTPException(f"WorkspaceModel with id {id} not found") diff --git a/frontend/src/views/system/workspace/index.vue b/frontend/src/views/system/workspace/index.vue index 2363aadf..a18cec04 100644 --- a/frontend/src/views/system/workspace/index.vue +++ b/frontend/src/views/system/workspace/index.vue @@ -358,7 +358,7 @@ const handleCurrentChange = (val: number) => { {{ $t('dashboard.rename') }} -
+