Implement same ID type as backend API

This commit is contained in:
2025-06-09 14:14:53 +02:00
parent 36d04b8a33
commit 71d877022b
2 changed files with 28 additions and 29 deletions

View File

@ -88,7 +88,7 @@ def create_router(dependencies: FrontendDependencies) -> APIRouter:
client: Annotated[ClientUpdate, Form()],
):
"""Update a client."""
original_client = await admin.get_client(id)
original_client = await admin.get_client(("id", id))
if not original_client:
return templates.TemplateResponse(
request, "fragments/error.html", {"message": "Client not found"}
@ -131,7 +131,7 @@ def create_router(dependencies: FrontendDependencies) -> APIRouter:
admin: Annotated[AdminBackend, Depends(dependencies.get_admin_backend)],
) -> Response:
"""Delete a client."""
await admin.delete_client(id)
await admin.delete_client(("id", id))
clients = await admin.get_clients()
headers = {"Hx-Refresh": "true"}
return templates.TemplateResponse(