Update src/frontend/lib/FastAPIServer.py

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
This commit is contained in:
th3r00t
2025-08-11 12:31:07 -04:00
committed by GitHub
parent 12810d0cc0
commit 93b4c19ef8

View File

@@ -222,7 +222,9 @@ class FastAPIServer():
async def book(request: Request, book_id: int):
storage = Storage(Config(os.path.abspath(os.getcwd())))
book = storage.get_book(book_id)
file_path = book[0].file_name
if book is None:
return JSONResponse(status_code=404, content={"error": "Book not found"})
file_path = book.file_name
if not os.path.exists(file_path):
return JSONResponse(status_code=404, content={"error": "File not found"})
"""Book file responder."""