Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
return mirror
+@router.delete("/{hostname}")
+async def delete_mirror(
+ mirror: Mirror = fastapi.Depends(get_mirror_from_path),
+ current_user: User = fastapi.Depends(auth.get_current_admin),
+) -> fastapi.Response:
+ # Delete the mirror
+ async with backend.db as session:
+ await mirror.delete(deleted_by=current_user)
+
+ # Send 204
+ return fastapi.Response(status_code=204)
+
@router.post("/{hostname}/check")
async def check_mirror(
mirror: Mirror = fastapi.Depends(get_mirror_from_path),