diff --git a/src/aeros_project/router.py b/src/aeros_project/router.py index f13e61d..78330b4 100644 --- a/src/aeros_project/router.py +++ b/src/aeros_project/router.py @@ -15,7 +15,7 @@ router = APIRouter() @router.get("", response_model=StandardResponse[None]) -async def save_all_default(db_session: DbSession, project_name: str = "trialapi"): +async def import_aro(db_session: DbSession, aeros_project_in: AerosProjectInput, project_name: str = "trialapi"): await import_aro_project(db_session=db_session) return {"data": None, "status": "success", "message": "Success"} diff --git a/src/aeros_project/service.py b/src/aeros_project/service.py index 54f5d65..a829ba4 100644 --- a/src/aeros_project/service.py +++ b/src/aeros_project/service.py @@ -43,11 +43,23 @@ async def import_aro_project(*, db_session: DbSession): project_name = "trialapi" ## save File to windows app # Output is string of file path, examole + # # Example response "C/dsad/dsad.aro" + # try: + # response = await client.post( + # f"{windows_BASE_URL}/upload", + # json=f"/", + # headers={"Content-Type": "application/json"}, + # ) + # response.raise_for_status() + # except Exception as e: + # raise HTTPException( + # status_code=status.HTTP_500_INTERNAL_SERVER_ERROR, detail=str(e) + # ) + aro_path = r"C:/Users/user/Documents/Aeros/sample_project.aro" aeros_project = AerosProject(project_name=project_name, aro_file_path=aro_path) - db_session.add(aeros_project) await db_session.commit()