Update code in endpoints\books.get.py

This commit is contained in:
Backend IM Bot 2025-03-20 15:47:06 +01:00
parent ef6bae8843
commit 9a30538b53

13
endpoints/books.get.py Normal file
View File

@ -0,0 +1,13 @@
from fastapi import APIRouter, Depends, HTTPException
from core.database import fake_books_db
router = APIRouter()
@router.get("/books")
async def get_books_handler():
"""Get all books in the library"""
books = list(fake_books_db.values())
return {
"message": "Books retrieved successfully",
"data": books
}