From 75e64a7f76cec6ad84697bdd321ecb393e499fb5 Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Fri, 28 Mar 2025 11:45:55 -0500 Subject: [PATCH] Update code in endpoints/tk.post.py --- endpoints/tk.post.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 endpoints/tk.post.py diff --git a/endpoints/tk.post.py b/endpoints/tk.post.py new file mode 100644 index 0000000..6d368b1 --- /dev/null +++ b/endpoints/tk.post.py @@ -0,0 +1,14 @@ +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 \ No newline at end of file