Do the following with your small group:
-
Review parts 1-7 together
-
If you all got through the section about versioning, review that together as well. If not everyone did it, work on it together.
-
Create an endpoint to sell a book
- request:
PATCH /api/v1/books/1/sell
- response:
{ "id": 1, "title": "The Moving Finger", "author": "Cortez Shields II", "genre": "Fable", "summary": "Omnis vitae fugiat. Nesciunt eos eius. Aperiam atque nihil.", "number_sold": 2, "created_at": "2022-10-17T15:10:51.614Z", "updated_at": "2022-10-17T15:10:51.614Z" }
- Assuming
number_sold
was originally 1
- request:
-
Update your
GET /api/v1/books
endpoint to get books with a certain reading level- request:
GET /api/v1/books?reading_level=3
- response:
[ { "id": 1, "title": "The Moving Finger", "author": "Cortez Shields II", "genre": "Fable", "summary": "Omnis vitae fugiat. Nesciunt eos eius. Aperiam atque nihil.", "number_sold": 2, "reading_level": 3, "created_at": "2022-10-17T15:10:51.614Z", "updated_at": "2022-10-17T15:10:51.614Z" }, { "id": 2, "title": "Dulce et Decorum Est", "author": "Cornell Schaefer", "genre": "Folklore", "summary": "Est distinctio autem. Adipisci maxime eligendi. Repudiandae quas sed.", "number_sold": 5, "reading_level": 3, "created_at": "2022-10-17T15:10:51.617Z", "updated_at": "2022-10-17T15:10:51.617Z" }, ... ]
- request: