From 184734fd34a55d2513dfea77b5dd3978c68b2a5b Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Mon, 24 Mar 2025 22:31:16 +0000 Subject: [PATCH] Update code in endpoints/user.post.py --- endpoints/user.post.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/endpoints/user.post.py b/endpoints/user.post.py index e69de29..48432ec 100644 --- a/endpoints/user.post.py +++ b/endpoints/user.post.py @@ -0,0 +1,21 @@ +from fastapi import APIRouter, HTTPException + +users = [] # In-memory storage + +router = APIRouter() + +@router.post("/user") +async def get_users(): + """Get all registered users endpoint""" + if not users: + raise HTTPException(status_code=404, detail="No users found") + + return { + "message": "Users retrieved successfully", + "users": users, + "total_users": len(users), + "next_steps": [ + "Filter users by status", + "Paginate results" + ] + } \ No newline at end of file