From: Michael Tremer Date: Tue, 17 Jun 2025 09:47:58 +0000 (+0000) Subject: API: Implement deleting uploads X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5fd68fbbde8c4c525d8e71536465f5a9d80f474f;p=pbs.git API: Implement deleting uploads Signed-off-by: Michael Tremer --- diff --git a/src/api/uploads.py b/src/api/uploads.py index dc97fc13..329010e2 100644 --- a/src/api/uploads.py +++ b/src/api/uploads.py @@ -59,6 +59,13 @@ async def get_upload(id: uuid.UUID, async def get(upload: uploads.Upload = fastapi.Depends(get_upload)) -> uploads.Upload: return upload +@router.delete("/{id}") +async def delete(upload: uploads.Upload = fastapi.Depends(get_upload)): + # Delete the upload + await upload.delete() + + # Send 204 + return fastapi.Response(status_code=204) # Add everything to the app app.include_router(router)