Skip to content

Hometask #10. Create update, get and delete endpoints#1

Open
VsevolodSheiko wants to merge 2 commits into
p1v2:mainfrom
VsevolodSheiko:main
Open

Hometask #10. Create update, get and delete endpoints#1
VsevolodSheiko wants to merge 2 commits into
p1v2:mainfrom
VsevolodSheiko:main

Conversation

@VsevolodSheiko

Copy link
Copy Markdown

No description provided.

Comment thread app/routers/books.py

@router.put("/books/{book_id}", response_model=BookModel, status_code=200)
async def update_book(book_id: int, book_update: BookUpdate, session=Depends(get_session)):
for var, value in vars(book_update).items():

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't see any query, when you get the book from database.
if book is found, you should update it, otherwise return 404.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants