From 67c4d2624d35d16c50e6fea99663d1e03b1f83b2 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 25 Mar 2025 07:35:40 +0100 Subject: [PATCH] Update code in endpoints/footing.post.py --- endpoints/footing.post.py | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/endpoints/footing.post.py b/endpoints/footing.post.py index 3660bee..18eb06e 100644 --- a/endpoints/footing.post.py +++ b/endpoints/footing.post.py @@ -8,22 +8,23 @@ router = APIRouter() @router.post("/footing") async def save_game( - name: str, + title: str, description: str, - category: str + genre: str, + platform: str ): """Save a new game to the database""" if request.method != "POST": raise HTTPException(status_code=405, detail="Method Not Allowed") game_id = str(uuid.uuid4()) - game = { + games.append({ "id": game_id, - "name": name, - "description": description, - "category": category - } - games.append(game) + "title": title, + "description": description, + "genre": genre, + "platform": platform + }) return { "method": "POST", @@ -34,13 +35,13 @@ async def save_game( @router.get("/games") async def get_games(): - """Fetch all games from the database""" + """Fetch all saved games from the database""" if request.method != "GET": raise HTTPException(status_code=405, detail="Method Not Allowed") - + return { "method": "GET", - "_verb": "get", + "_verb": "get", "games": games } ``` \ No newline at end of file