From 7964799af146499e64859d02de84ff1429871607 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 25 Mar 2025 07:36:18 +0100 Subject: [PATCH] Update code in endpoints/footing.post.py --- endpoints/footing.post.py | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/endpoints/footing.post.py b/endpoints/footing.post.py index 18eb06e..575a9cf 100644 --- a/endpoints/footing.post.py +++ b/endpoints/footing.post.py @@ -1,4 +1,3 @@ -```python from fastapi import APIRouter, HTTPException import uuid @@ -9,7 +8,6 @@ router = APIRouter() @router.post("/footing") async def save_game( title: str, - description: str, genre: str, platform: str ): @@ -18,13 +16,13 @@ async def save_game( raise HTTPException(status_code=405, detail="Method Not Allowed") game_id = str(uuid.uuid4()) - games.append({ + game = { "id": game_id, "title": title, - "description": description, - "genre": genre, + "genre": genre, "platform": platform - }) + } + games.append(game) return { "method": "POST", @@ -38,10 +36,9 @@ async def get_games(): """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", + "method": "GET", + "_verb": "get", "games": games - } -``` \ No newline at end of file + } \ No newline at end of file