From e0e1785bf75467af2235c6afd5f8c225790ba84c Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Sun, 23 Mar 2025 17:51:12 +0100 Subject: [PATCH] Update code in endpoints/logout.post.py --- endpoints/logout.post.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/endpoints/logout.post.py b/endpoints/logout.post.py index c447b0a..6dc6759 100644 --- a/endpoints/logout.post.py +++ b/endpoints/logout.post.py @@ -2,24 +2,22 @@ from fastapi import APIRouter, HTTPException laptops = [ {"name": "Dell XPS 13"}, - {"name": "MacBook Pro 16"}, {"name": "Lenovo ThinkPad X1 Carbon"}, {"name": "HP Spectre x360"}, + {"name": "Apple MacBook Pro"}, {"name": "Asus ZenBook Pro Duo"} ] router = APIRouter() -@router.post("/logout", response_model=list) +@router.post("/logout") async def logout(): """Returns list of laptop names""" if request.method != "POST": raise HTTPException(status_code=405, detail="Method Not Allowed") - laptop_names = [laptop["name"] for laptop in laptops] - return { "method": "POST", "_verb": "post", - "data": laptop_names + "laptops": [laptop["name"] for laptop in laptops] } \ No newline at end of file