update docs and bump version

This commit is contained in:
collerek
2020-10-27 18:18:09 +01:00
parent 82e3eb94ae
commit 8b37a14131
4 changed files with 30 additions and 7 deletions

View File

@ -72,6 +72,8 @@ async def get_item(item_id: int, item: Item):
@app.delete("/items/{item_id}")
async def delete_item(item_id: int, item: Item):
async def delete_item(item_id: int, item: Item = None):
if item:
return {"deleted_rows": await item.delete()}
item_db = await Item.objects.get(pk=item_id)
return {"deleted_rows": await item_db.delete()}