13 lines
407 B
Python
13 lines
407 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
from typing import List
|
|
from core.database import get_db
|
|
from schemas.sale import SaleSchema
|
|
from helpers.sale_helpers import get_all_sales
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/Sales", status_code=200, response_model=List[SaleSchema])
|
|
async def get_sales(db: Session = Depends(get_db)):
|
|
sales = get_all_sales(db)
|
|
return sales |