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.
This commit is contained in:
Fusion
2026-05-19 15:34:26 +02:00
parent 2d078c8b1e
commit 7fc8b82621
+10
View File
@@ -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,