From 5fd68fbbde8c4c525d8e71536465f5a9d80f474f Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 17 Jun 2025 09:47:58 +0000 Subject: [PATCH] API: Implement deleting uploads Signed-off-by: Michael Tremer --- src/api/uploads.py | 7 +++++++ 1 file changed, 7 insertions(+) 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) -- 2.47.2