async def handle_post_projects(project: projects.schemas.project.ProjectCreate, session: Session = Depends(session_scope)): """ Handles POST requests to /. Parameters ---------- project : projects.schemas.project.ProjectCreate session : sqlalchemy.orm.session.Session Returns ------- projects.schemas.project.Project """ project_controller = ProjectController(session) project = project_controller.create_project(project=project) return project
async def handle_post_projects( project: projects.schemas.project.ProjectCreate, session: Session = Depends(database.session_scope), kubeflow_userid: Optional[str] = Header(database.DB_TENANT), ): """ Handles POST requests to /. Parameters ---------- project : projects.schemas.project.ProjectCreate session : sqlalchemy.orm.session.Session kubeflow_userid : fastapi.Header Returns ------- projects.schemas.project.Project """ project_controller = ProjectController(session, kubeflow_userid=kubeflow_userid) project = project_controller.create_project(project=project) return project