From cf88f22adfa94a8c36507572faa5d57fa89da67b Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 29 Jun 2025 18:06:22 +0000 Subject: [PATCH] API: Create a new sub-router for builds Signed-off-by: Michael Tremer --- src/api/builds.py | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/src/api/builds.py b/src/api/builds.py index 21057aac..97a6004f 100644 --- a/src/api/builds.py +++ b/src/api/builds.py @@ -26,7 +26,13 @@ from . import backend from .. import builds -@apiv1.get("/builds/{build_id}") +# Create a new router for all builds endpoints +router = fastapi.APIRouter( + prefix="/builds", + tags=["Builds"], +) + +@router.get("/{build_id}") async def get(build_id: uuid.UUID) -> builds.Build: build = await backend.builds.get_by_uuid(build_id) @@ -35,3 +41,6 @@ async def get(build_id: uuid.UUID) -> builds.Build: raise fastapi.HTTPException(404, "Build not found") return build + +# Add everything to the APIv1 +apiv1.include_router(router) -- 2.47.2