File size: 323 Bytes
9d4bd7c |
1 2 3 4 5 6 7 8 9 10 11 |
from App.schemas import AppException
from .models import User
async def get_current_user(user_id: int):
"""Get current user by ID"""
user = await User.get_or_none(id=user_id)
if not user:
raise AppException(status_code=404, detail="User not found")
return user ## can you implement this function |