Update code in endpoints/books.get.py
This commit is contained in:
parent
0de28a0cc1
commit
91d7edf02d
13
endpoints/books.get.py
Normal file
13
endpoints/books.get.py
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
from fastapi import APIRouter, Depends, HTTPException
|
||||||
|
from core.database import fake_users_db
|
||||||
|
|
||||||
|
router = APIRouter()
|
||||||
|
|
||||||
|
@router.get("/books")
|
||||||
|
async def books_handler():
|
||||||
|
"""Get all books"""
|
||||||
|
books = list(fake_users_db.values())
|
||||||
|
return {
|
||||||
|
"message": "Books retrieved successfully",
|
||||||
|
"data": books
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user