Update code in endpoints/tk.post.py
This commit is contained in:
parent
f14ab3bd90
commit
75e64a7f76
14
endpoints/tk.post.py
Normal file
14
endpoints/tk.post.py
Normal file
@ -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
|
Loading…
x
Reference in New Issue
Block a user