Skip to content

Commit

Permalink
fix: return the whole project to be able to display its config when c…
Browse files Browse the repository at this point in the history
…reated
  • Loading branch information
Sparkier committed Sep 27, 2023
1 parent 10e8c12 commit 033ea27
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions backend/zeno_backend/routers/sdk.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def verify_api_key(self, api_key: str) -> bool:
router = APIRouter(tags=["zeno"], dependencies=[Depends(APIKeyBearer())])


@router.post("/project", status_code=200)
@router.post("/project", status_code=200, response_model=Project)
def create_project(
project: Project, response: Response, api_key=Depends(APIKeyBearer())
):
Expand All @@ -102,6 +102,8 @@ def create_project(
status_code=status.HTTP_401_UNAUTHORIZED,
detail=("ERROR: Invalid API key."),
)
owner_name = select.user_name_by_api_key(api_key)
project.owner_name = owner_name if owner_name is not None else ""

if project.view not in VIEWS:
raise HTTPException(
Expand Down Expand Up @@ -135,7 +137,7 @@ def create_project(
)
insert.project(project, user_id)
response.status_code = status.HTTP_201_CREATED
return project.uuid
return project


@router.post("/dataset/{project}")
Expand Down

0 comments on commit 033ea27

Please sign in to comment.