From d2be4d1690bd52d374b264b46cc16c4a6217b59f Mon Sep 17 00:00:00 2001 From: Iam54r1n4 Date: Thu, 30 Jan 2025 20:34:51 +0000 Subject: [PATCH] Refactor misc endpoints --- core/scripts/webpanel/routers/api/v1/config/misc.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/core/scripts/webpanel/routers/api/v1/config/misc.py b/core/scripts/webpanel/routers/api/v1/config/misc.py index a73a6ba..949d55b 100644 --- a/core/scripts/webpanel/routers/api/v1/config/misc.py +++ b/core/scripts/webpanel/routers/api/v1/config/misc.py @@ -5,10 +5,11 @@ import cli_api router = APIRouter() -@router.get('/install-tcp-brutal', response_model=DetailResponse) +@router.post('/install-tcp-brutal', response_model=DetailResponse, summary='Install TCP Brutal') async def install_tcp_brutal(): """ Endpoint to install TCP Brutal service. + It's post method because keeping backward compatibility if we need to add parameters in the future. Returns: DetailResponse: A response object indicating the success of the installation. @@ -23,7 +24,7 @@ async def install_tcp_brutal(): raise HTTPException(status_code=400, detail=f'Error: {str(e)}') -@router.get('/update-geo/{country}', response_model=DetailResponse) +@router.get('/update-geo/{country}', response_model=DetailResponse, summary='Update Geo files') async def update_geo(country: str): """ Endpoint to update geographic data files based on the specified country.