Update code in endpoints/api/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa.post.py
This commit is contained in:
parent
d97caffd4b
commit
8830e66ba2
@ -0,0 +1,26 @@
|
||||
from fastapi import APIRouter, Depends, HTTPException
|
||||
from core.database import fake_users_db
|
||||
|
||||
router = APIRouter()
|
||||
|
||||
@router.post("/api/aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa")
|
||||
async def aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa_handler(
|
||||
username: str = "demo"
|
||||
):
|
||||
"""Fetch user data endpoint"""
|
||||
user = fake_users_db.get(username)
|
||||
if not user:
|
||||
raise HTTPException(status_code=400, detail="User not found")
|
||||
|
||||
return {
|
||||
"message": "User data retrieved successfully",
|
||||
"user": {
|
||||
"username": username,
|
||||
"email": user["email"],
|
||||
"id": user["id"]
|
||||
},
|
||||
"metadata": {
|
||||
"source": "demo_db",
|
||||
"timestamp": "2024-01-01T00:00:00Z"
|
||||
}
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user