From 14e36905628ff833dd5c3837d78a09ba0d738d40 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sun, 23 Mar 2025 17:31:21 +0100 Subject: [PATCH] Update code in endpoints/logout.post.py --- endpoints/logout.post.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/endpoints/logout.post.py b/endpoints/logout.post.py index 2232982..fd45118 100644 --- a/endpoints/logout.post.py +++ b/endpoints/logout.post.py @@ -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] } \ No newline at end of file