13 lines
416 B
Python
13 lines
416 B
Python
from fastapi import APIRouter, Depends
|
|
from typing import List
|
|
from sqlalchemy.orm import Session
|
|
from core.database import get_db
|
|
from schemas.anime import AnimeSchema
|
|
from helpers.anime_helpers import get_all_animes
|
|
|
|
router = APIRouter()
|
|
|
|
@router.get("/anime", status_code=200, response_model=List[AnimeSchema])
|
|
async def get_animes(db: Session = Depends(get_db)):
|
|
animes = get_all_animes(db)
|
|
return animes |