|
|
|
@ -26,7 +26,9 @@ async def read_items( |
|
|
|
if id: |
|
|
|
item = data.get(id) |
|
|
|
if item is None: |
|
|
|
raise HTTPException(status_code=404, detail=f"Item with id '{id}' not found") |
|
|
|
raise HTTPException( |
|
|
|
status_code=404, detail=f"Item with id '{id}' not found" |
|
|
|
) |
|
|
|
else: |
|
|
|
id, item = random.choice(list(data.items())) |
|
|
|
return {"id": id, "name": item} |
|
|
|
|