backend/items/router.py
2025-05-05 15:02:44 +03:00

18 lines
488 B
Python

from .models import UserProfile
from fastapi import APIRouter, Depends
from typing import Annotated
from ..auth.models import get_current_active_user
router = APIRouter(
prefix="/items",
tags=["items"],
responses={404: {"description": "Not found"}},
dependencies=[],
)
@router.get('/profile', response_model=UserProfile)
async def get_user_profile(
current_user: Annotated[UserProfile, Depends(get_current_active_user)]
) -> UserProfile:
return current_user