mirror of
https://gitlab.aachen.ccc.de/inventory/in.git
synced 2024-11-29 10:13:59 +01:00
update openapi docs for PUT request
This commit is contained in:
parent
6d01523d8d
commit
2b7342b902
1 changed files with 5 additions and 1 deletions
6
main.py
6
main.py
|
@ -44,7 +44,11 @@ async def list_items(db: Session = Depends(get_db)):
|
||||||
return {i.id: i for i in items}
|
return {i.id: i for i in items}
|
||||||
|
|
||||||
|
|
||||||
@app.put("/api/items/{id}")
|
@app.put(
|
||||||
|
"/api/items/{id}",
|
||||||
|
status_code=201,
|
||||||
|
responses={201: {"description": "created"}, 204: {"description": "updated"}},
|
||||||
|
)
|
||||||
async def put_item(id: str, item: Item, db: Session = Depends(get_db)):
|
async def put_item(id: str, item: Item, db: Session = Depends(get_db)):
|
||||||
if item.last_updated is None:
|
if item.last_updated is None:
|
||||||
item.last_updated = month_timestamp()
|
item.last_updated = month_timestamp()
|
||||||
|
|
Loading…
Reference in a new issue