From 7fc8b826216fcd1f5dc87323602a3f2f1cfde19a Mon Sep 17 00:00:00 2001 From: Fusion Date: Tue, 19 May 2026 15:34:26 +0200 Subject: [PATCH] fix: add missing GET /projects/{id} endpoint Frontend workspace was calling GET /projects/{id} which didn't exist, causing 405 errors and preventing WorkspaceHeader from rendering. Add get_project endpoint that returns a single project by ID with ownership verification. --- apps/api/src/api/projects.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/apps/api/src/api/projects.py b/apps/api/src/api/projects.py index 72f166b..664b22b 100644 --- a/apps/api/src/api/projects.py +++ b/apps/api/src/api/projects.py @@ -76,6 +76,16 @@ async def list_projects( return list(result.scalars().all()) +@router.get("/{project_id}", response_model=ProjectResponse) +async def get_project( + project_id: uuid.UUID, + user_id: uuid.UUID = Depends(get_current_user_id), + session: AsyncSession = Depends(get_db_session), +) -> Project: + await _get_user(session, user_id) + return await _get_owned_project(project_id, user_id, session) + + async def _get_owned_project( project_id: uuid.UUID, user_id: uuid.UUID,