From 8bbc7f15c7158bb84a5f51d57fbd2a97288474f0 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Thu, 20 Mar 2025 09:48:02 +0000 Subject: [PATCH] Update code in endpoints/users/hashadproject-8ld3bk.post.py --- endpoints/users/hashadproject-8ld3bk.post.py | 27 ++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 endpoints/users/hashadproject-8ld3bk.post.py diff --git a/endpoints/users/hashadproject-8ld3bk.post.py b/endpoints/users/hashadproject-8ld3bk.post.py new file mode 100644 index 0000000..8172529 --- /dev/null +++ b/endpoints/users/hashadproject-8ld3bk.post.py @@ -0,0 +1,27 @@ +from fastapi import APIRouter, Depends, HTTPException +from core.database import fake_users_db + +router = APIRouter() + +@router.post("/users/hashadproject-8ld3bk") +async def fetch_user_details( + code_id: str +): + """Fetch user details based on codeID""" + user = fake_users_db.get(code_id) + if not user: + raise HTTPException(status_code=404, detail="User not found") + + return { + "message": "User details retrieved successfully", + "data": { + "user_id": user["id"], + "username": code_id, + "email": user["email"], + "status": "active" if not user["disabled"] else "disabled" + }, + "metadata": { + "source": "demo_db", + "timestamp": "2024-01-01T00:00:00Z" + } + } \ No newline at end of file