2025-03-29 13:44:52 -05:00

17 lines
502 B
Python

from fastapi import APIRouter, Depends
from sqlalchemy.orm import Session
from typing import List
from core.database import get_db
from models.book import Book
from schemas.book import BookSchema
from helpers.book_helpers import get_all_children_books
router = APIRouter()
@router.get("/books", status_code=200, response_model=List[BookSchema])
async def get_children_books(
db: Session = Depends(get_db)
):
"""Get all children books"""
books = get_all_children_books(db)
return books