Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: return the whole project to be able to display its config when c… #232

Merged
merged 1 commit into from
Sep 27, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading