Update code in endpoints/profile.get.py

This commit is contained in:
Backend IM Bot 2025-03-23 16:27:06 +00:00
parent 3e9be1e82c
commit bb42209dc4

View File

@ -0,0 +1,29 @@
from fastapi import APIRouter, HTTPException
users = [] # In-memory storage
router = APIRouter()
@router.get("/profile")
async def get_profile(
firstname: str = "John",
lastname: str = "Doe",
email: str = "john@example.com"
):
"""Get user profile endpoint"""
user = next((u for u in users if u["email"] == email), None)
if not user:
raise HTTPException(status_code=404, detail="Profile not found")
return {
"message": "Profile retrieved successfully",
"user": {
"firstname": firstname,
"lastname": lastname,
"email": email
},
"features": {
"profile_complete": True,
"verified": False
}
}