We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
read_item
1 parent 141f6cd commit dc712acCopy full SHA for dc712ac
{{cookiecutter.project_slug}}/backend/app/app/api/api_v1/endpoints/items.py
@@ -68,7 +68,7 @@ def update_item(
68
69
70
@router.get("/{id}", response_model=Item)
71
-def read_user_me(
+def read_item(
72
*,
73
db: Session = Depends(get_db),
74
id: int,
@@ -79,7 +79,7 @@ def read_user_me(
79
"""
80
item = crud.item.get(db_session=db, id=id)
81
if not item:
82
- raise HTTPException(status_code=400, detail="Item not found")
+ raise HTTPException(status_code=404, detail="Item not found")
83
if not crud.user.is_superuser(current_user) and (item.owner_id != current_user.id):
84
raise HTTPException(status_code=400, detail="Not enough permissions")
85
return item
0 commit comments