From 6a7da9a0d4499fb724f3a337dd1eb5cf8e84aa60 Mon Sep 17 00:00:00 2001 From: Sujan Adhikari <109404840+Sujanadh@users.noreply.github.com> Date: Tue, 2 Jan 2024 02:29:34 +0545 Subject: [PATCH] hotfix: location str in create project (#1073) Co-authored-by: sujanadh --- src/backend/app/projects/project_routes.py | 2 +- src/backend/app/projects/project_schemas.py | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/backend/app/projects/project_routes.py b/src/backend/app/projects/project_routes.py index e948db821d..8e4748ebfb 100644 --- a/src/backend/app/projects/project_routes.py +++ b/src/backend/app/projects/project_routes.py @@ -198,7 +198,7 @@ async def search_project( return response -@router.get("/{project_id}", response_model=project_schemas.ProjectOut) +@router.get("/{project_id}", response_model=project_schemas.ReadProject) async def read_project(project_id: int, db: Session = Depends(database.get_db)): project = await project_crud.get_project_by_id(db, project_id) if not project: diff --git a/src/backend/app/projects/project_schemas.py b/src/backend/app/projects/project_schemas.py index a40641974c..8308444aa2 100644 --- a/src/backend/app/projects/project_schemas.py +++ b/src/backend/app/projects/project_schemas.py @@ -130,7 +130,7 @@ class ProjectBase(BaseModel): author: User project_info: ProjectInfo status: ProjectStatus - location_str: str + # location_str: str outline_geojson: Optional[GeojsonFeature] = None project_tasks: Optional[List[tasks_schemas.Task]] xform_title: Optional[str] = None @@ -141,6 +141,10 @@ class ProjectBase(BaseModel): class ProjectOut(ProjectBase): project_uuid: uuid.UUID = uuid.uuid4() +class ReadProject(ProjectBase): + project_uuid: uuid.UUID = uuid.uuid4() + location_str: str + class BackgroundTaskStatus(BaseModel): status: str