Update code in endpoints/yolo-post.post.py

This commit is contained in:
Backend IM Bot 2025-03-13 22:30:10 +01:00
parent 446d7ac9ba
commit 3e7ae63ab5

View File

@ -4,9 +4,10 @@ from core.database import fake_users_db
router = APIRouter() router = APIRouter()
@router.post("/yolo-post") @router.post("/yolo-post")
async def yolo_post_handler(sentence: str): async def yolo_post_handler(sentence: str = Body(...)):
"""Echo a sentence backwards""" """Echo sentence backwards"""
reversed_sentence = sentence[::-1] reversed_sentence = sentence[::-1]
return { return {
"message": "Sentence reversed successfully", "message": "Sentence reversed successfully",
"original_sentence": sentence, "original_sentence": sentence,