diff --git a/goosebit/api/v1/software/requests.py b/goosebit/api/v1/software/requests.py index 6a39756e..8ce35c27 100644 --- a/goosebit/api/v1/software/requests.py +++ b/goosebit/api/v1/software/requests.py @@ -1,5 +1,5 @@ -from pydantic import BaseModel +from pydantic import RootModel -class SoftwareDeleteRequest(BaseModel): - files: list[int] +class SoftwareDeleteRequest(RootModel[list[int]]): + pass diff --git a/goosebit/api/v1/software/routes.py b/goosebit/api/v1/software/routes.py index b36fb1ac..98d9bb13 100644 --- a/goosebit/api/v1/software/routes.py +++ b/goosebit/api/v1/software/routes.py @@ -26,7 +26,7 @@ async def software_get(_: Request) -> SoftwareResponse: ) async def software_delete(_: Request, config: SoftwareDeleteRequest) -> StatusResponse: success = False - for f_id in config.files: + for f_id in config.root: software = await Software.get_or_none(id=f_id) if software is None: