2025-03-28 17:12:58 +00:00

17 lines
489 B
Python

from fastapi import APIRouter, Depends, HTTPException, status
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from models.user import User
from schemas.user import UserSchema
from helpers.user_helpers import get_all_users
router = APIRouter()
@router.get("/users", status_code=200, response_model=List[UserSchema])
async def get_users(
db: Session = Depends(get_db)
):
"""Get all users"""
users = get_all_users(db)
return users