Update code in endpoints/logout.post.py
This commit is contained in:
parent
0e1485d316
commit
14e3690562
@ -14,10 +14,14 @@ router = APIRouter()
|
||||
async def logout():
|
||||
"""Returns list of laptop names"""
|
||||
if request.method != "POST":
|
||||
raise HTTPException(status_code=405, detail="Method Not Allowed")
|
||||
raise HTTPException(status_code=405, detail={
|
||||
"message": "Method Not Allowed",
|
||||
"method": "POST",
|
||||
"_verb": "post"
|
||||
})
|
||||
|
||||
return {
|
||||
"method": "POST",
|
||||
"_verb": "post",
|
||||
"data": [laptop["name"] for laptop in laptops]
|
||||
"laptops": [laptop["name"] for laptop in laptops]
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user