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

Feat/mymdc: add runs endpoint #14

Merged
merged 3 commits into from
Oct 2, 2024
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
4 changes: 3 additions & 1 deletion src/zulip_write_only_proxy/routers/mymdc.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from .. import logger, models, mymdc
from .api import get_client

type ScopedClient = Annotated[models.ScopedClient, Depends(get_client)]
ScopedClient = Annotated[models.ScopedClient, Depends(get_client)]


async def proxy_request(mymdc_path: str, params) -> Response:
Expand Down Expand Up @@ -43,6 +43,7 @@ async def check_and_proxy_request(

res_proposal_id = (
content.get("proposal_id")
or content.get("experiment", {}).get("proposal_id")
or content.get("proposal", {}).get("id")
or content.get("id")
)
Expand Down Expand Up @@ -107,6 +108,7 @@ async def get_proposals_runs(

@router.get("/samples/{id}")
@router.get("/experiments/{id}")
@router.get("/runs/{id}")
async def get_with_id(request: Request, client: ScopedClient, id: int):
return await check_and_proxy_request(
request,
Expand Down
Loading