cake-9s2bvx/endpoints/tk.post.py
2025-03-28 11:45:55 -05:00

14 lines
363 B
Python

from fastapi import APIRouter, Depends
from models.book import Book
from schemas.book import BookCreate
from helpers.book_helpers import create_book
router = APIRouter()
@router.post("/tk", status_code=201)
async def generate_book(
book_data: BookCreate = Depends(),
db: Session = Depends(get_db)
):
book = create_book(db, book_data)
return book