diff --git a/Project 2/books2.py b/Project 2/books2.py index 57ec9355..729b53b6 100644 --- a/Project 2/books2.py +++ b/Project 2/books2.py @@ -106,6 +106,7 @@ async def update_book(book: BookRequest): if BOOKS[i].id == book.id: BOOKS[i] = book book_changed = True + break if not book_changed: raise HTTPException(status_code=404, detail='Item not found')