Accept branch parameter in webui

This commit is contained in:
Stéphane Bidoul 2022-01-26 17:40:41 +01:00
parent 65b0ebeeb4
commit 5955def4b8
No known key found for this signature in database
GPG key ID: BCAB2555446B5B92

View file

@ -57,10 +57,16 @@ def mount(app: FastAPI) -> None:
@router.get("/builds", response_class=RedirectResponse)
async def builds(repo: str, target_branch: str | None = None) -> Response:
async def builds(
repo: str,
target_branch: str | None = None,
branch: str | None = None,
) -> Response:
url = f"/webui/builds.html?repo={repo}"
if target_branch:
url += f"&target_branch={target_branch}"
if branch:
url += f"&branch={branch}"
return RedirectResponse(url=url)