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

Quick attempt at the first tier exercises #1

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

Conversation

thashepherd
Copy link
Collaborator

@thashepherd thashepherd commented Apr 18, 2024

  • Added genre field to Book. Now, running GET /books will return an additional genre field associated with each book:
{
	"title": "Cradle 2",
	"author": "Arthur D. Clarke",
	"publication_year": 1968,
	"rating": 5,
	"genre": "Science Fiction",
	"id": 0
}
  • Added /byauthor and /byyear endpoints to allow filtering books by author (last name) and publication year. Note that /byauthor uses a simple string contains, so it's best to use either last or first names but not both.
  • Added a (quick and dirty!) system for 'submitting' reviews for books, and deleting previously submitted reviews. Note that more refinement is necessary before this feature can go out, and that it would be more properly to submit it in a separate PR.
    POST /books/review/{book_id}:
{
	"title": "Shogun",
	"author": "James Clavell",
	"genre": "Historical Fiction",
	"publication_year": 1975,
	"reviews": [
		{
			"submitter": "Noah",
			"rating": 4
		},
		{
			"submitter": "Asta",
			"rating": 5
		},
		{
			"submitter": "Matt Alioto",
			"rating": 10
		}
	],
	"id": 0,
	"average_rating": 6.33
}

A DELETE /books/review/{book_id}/{submitter} endpoint has been included as well.

@thashepherd thashepherd changed the title Did first two simple exercises Quick attempt at the first tier exercises Apr 19, 2024
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.

1 participant