Add POS endpoint for /user
This commit is contained in:
parent
37677f3b04
commit
b0def99f22
17
endpoints/user.pos.py
Normal file
17
endpoints/user.pos.py
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
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
|
Loading…
x
Reference in New Issue
Block a user