make return value of crud.put_item easier to understand

This commit is contained in:
clonejo 2024-01-14 18:57:32 +01:00
parent eba9b410c6
commit 99df802a40
2 changed files with 11 additions and 2 deletions

View file

@ -44,7 +44,7 @@ async def list_items(db: Session = Depends(get_db)):
@app.put("/api/items/{id}")
async def put_item(id: str, item: Item, db: Session = Depends(get_db)):
if crud.put_item(db, id, item):
if crud.put_item(db, id, item) == crud.PutItemResult.UPDATED:
return Response(b"", status_code=204)
return Response(b"", status_code=201)