13 lines
456 B
Python
13 lines
456 B
Python
from fastapi import APIRouter, Depends
|
|
from typing import List
|
|
from sqlalchemy.orm import Session
|
|
from core.database import get_db
|
|
from schemas.online_order import OnlineOrderSchema
|
|
from helpers.online_order_helpers import get_all_online_orders
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/order", status_code=200, response_model=List[OnlineOrderSchema])
|
|
async def get_orders(db: Session = Depends(get_db)):
|
|
orders = get_all_online_orders(db)
|
|
return orders |