From 23474fb3d3524a6135ce5a1fa593f11655cd71cb Mon Sep 17 00:00:00 2001 From: Backend IM Bot Date: Tue, 25 Mar 2025 23:20:41 +0000 Subject: [PATCH] Add GET endpoint for /library --- endpoints/library.get.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/endpoints/library.get.py b/endpoints/library.get.py index 5eab723..e7e9d74 100644 --- a/endpoints/library.get.py +++ b/endpoints/library.get.py @@ -1,5 +1,5 @@ -# Entity: Book - +# Entity: Book, Author +```python from fastapi import APIRouter, Depends, HTTPException, status from sqlalchemy.orm import Session from typing import List @@ -15,4 +15,5 @@ async def get_books_by_authors( db: Session = Depends(get_db) ): books = db.query(Book).join(Author).all() - return books \ No newline at end of file + return books +``` \ No newline at end of file