16 lines
550 B
Python
16 lines
550 B
Python
from fastapi import APIRouter, Depends
|
|
from sqlalchemy.orm import Session
|
|
from core.database import get_db
|
|
from schemas.country import CountrySchema
|
|
from helpers.country_helpers import get_countries_by_names_or_codes
|
|
from typing import List
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/food-api", status_code=200, response_model=List[CountrySchema])
|
|
async def get_countries_by_names_or_codes_endpoint(
|
|
names_or_codes: List[str],
|
|
db: Session = Depends(get_db)
|
|
):
|
|
countries = get_countries_by_names_or_codes(db, names_or_codes)
|
|
return countries |