15 lines
576 B
Python

from fastapi import APIRouter, Depends
from ..dependencies import users_active
from ..models import users
from typing import Annotated
router = APIRouter()
@router.get("/users/", tags=["users"], response_model=list[users.User])
async def read_users(current_user: Annotated[users.User, Depends(users_active.get_current_active_user)]):
return users_active.fake_users
@router.get("/users/me",tags=["users"], response_model=users.User)
async def read_users_me(current_user: Annotated[users.User, Depends(users_active.get_current_active_user)]):
return current_user