Update code in endpoints/logout.post.py

This commit is contained in:
Backend IM Bot 2025-03-23 17:31:21 +01:00
parent 0e1485d316
commit 14e3690562

View File

@ -14,10 +14,14 @@ router = APIRouter()
async def logout(): async def logout():
"""Returns list of laptop names""" """Returns list of laptop names"""
if request.method != "POST": 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 { return {
"method": "POST", "method": "POST",
"_verb": "post", "_verb": "post",
"data": [laptop["name"] for laptop in laptops] "laptops": [laptop["name"] for laptop in laptops]
} }