From 9febf8a338758cf12fcb09ba11789e197ce002b4 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 11 Mar 2025 17:33:58 +0000 Subject: [PATCH] feat: Update endpoint signup --- app/api/endpoints/signup.py | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/app/api/endpoints/signup.py b/app/api/endpoints/signup.py index 4c6f9bc..0a07df4 100644 --- a/app/api/endpoints/signup.py +++ b/app/api/endpoints/signup.py @@ -1,13 +1,20 @@ -from fastapi import APIRouter, HTTPException +from fastapi import APIRouter, Depends, HTTPException, status from pydantic import BaseModel +from typing import Optional router = APIRouter() -class UserRegistration(BaseModel): - username: str - password: str - email: str +class RequestBody(BaseModel): + data: str -@router.post("/signup") -async def signup(user: UserRegistration): - return {"message": "User registered successfully", "user": user.username} \ No newline at end of file +@router.post("/api") +async def create_api(body: RequestBody): + """ + Create a simple API endpoint + """ + if not body.data: + raise HTTPException(status_code=status.HTTP_400_BAD_REQUEST, detail="Data is required") + + # Process the data and return a response + response_data = {"message": f"Received data: {body.data}"} + return response_data \ No newline at end of file