Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Solution #400

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Solution #400

wants to merge 2 commits into from

Conversation

Meksim-fesh
Copy link

No description provided.

Copy link

@mateacademy-ai-mentor mateacademy-ai-mentor left a comment

Choose a reason for hiding this comment

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

Great job on setting up the project! 🎉 The code meets the task requirements and is well-structured. Just a small note: consider adjusting the response models for the create_author and create_book endpoints to return the full created objects. Keep up the good work! 🚀

✨ Please rate this review in the Platform's notification center. I will be grateful for your feedback! ✨

main.py Outdated
return crud.get_books_list(db=db, author_id=author_id)


@app.post("/books/", response_model=schemas.BookCreate)

Choose a reason for hiding this comment

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

The response model for the create_book endpoint should be schemas.Book, not schemas.BookCreate, to return the created book with its ID.

main.py Outdated
return db_author


@app.post("/authors/", response_model=schemas.AuthorCreate)

Choose a reason for hiding this comment

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

The response model for the create_author endpoint should be schemas.Author, not schemas.AuthorCreate, to return the created author with its ID and associated books.

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