From 84cf1ee07903b097ef70aaaa02affdf68bc14326 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 21 Mar 2025 18:53:09 +0000 Subject: [PATCH] Update code in endpoints/button.get.py --- endpoints/button.get.py | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/endpoints/button.get.py b/endpoints/button.get.py index 27971da..6c45772 100644 --- a/endpoints/button.get.py +++ b/endpoints/button.get.py @@ -1,23 +1,21 @@ from fastapi import APIRouter, HTTPException -from fastapi.responses import JSONResponse +from fastapi.requests import Request router = APIRouter() -buttons = [] # In-memory storage - @router.get("/button") -async def get_button(): +async def button_demo(request: Request): """Demo button endpoint""" + if request.method != "GET": + raise HTTPException(status_code=405, detail="Method not allowed") + return { - "message": "Button retrieved successfully", - "button": { - "id": "btn_123", - "label": "Click Me", - "color": "blue", - "enabled": True - }, + "message": "Button clicked successfully", + "method": "GET", + "_verb": "get", + "status": "active", "features": { - "clickable": True, - "visible": True + "enabled": True, + "click_count": 1 } } \ No newline at end of file