16 lines
488 B
Python
16 lines
488 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.colour import Colour
|
|
from schemas.colour import ColourSchema
|
|
from helpers.colour_helpers import get_all_colours
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/colour", status_code=200, response_model=List[ColourSchema])
|
|
async def get_colours(
|
|
db: Session = Depends(get_db)
|
|
):
|
|
colours = get_all_colours(db)
|
|
return colours |