diff --git a/src/backend/app/tasks/task_routes.py b/src/backend/app/tasks/task_routes.py index cc37f152..9d473f8e 100644 --- a/src/backend/app/tasks/task_routes.py +++ b/src/backend/app/tasks/task_routes.py @@ -21,7 +21,7 @@ async def read_task( task_id: uuid.UUID, db: Annotated[Connection, Depends(database.get_db)], - user_data: AuthUser = Depends(login_required), + # user_data: AuthUser = Depends(login_required), ): "Retrieve details of a specific task by its ID." return await task_schemas.TaskDetailsOut.get_task_details(db, task_id) diff --git a/src/backend/app/tasks/task_schemas.py b/src/backend/app/tasks/task_schemas.py index b3bf77a7..2e1c5210 100644 --- a/src/backend/app/tasks/task_schemas.py +++ b/src/backend/app/tasks/task_schemas.py @@ -267,6 +267,7 @@ class TaskDetailsOut(BaseModel): side_overlap: Optional[float] = None gsd_cm_px: Optional[float] = None gimble_angles_degrees: Optional[int] = None + centroid: dict @field_validator("state", mode="after") @classmethod @@ -312,7 +313,8 @@ async def get_task_details(db: Connection, task_id: uuid.UUID): ), 'id', tasks.id ) AS outline, - + -- Calculate the centroid of the outline + ST_AsGeoJSON(ST_Centroid(tasks.outline))::jsonb AS centroid, te.created_at, te.updated_at, te.state,