MerryFairyTalesAD440 / API

1 stars 2 forks source link

All Methods "/Books" #87

Open niss3n opened 5 years ago

Fremonster commented 5 years ago

Created draft of the GET books/{bookid} function and deployed it to my testing resource. (1 hour)

Fremonster commented 5 years ago

Added the necessary Key vault code for all classes. Added validation to the POST /books and PUT /books/{bookid} and additional error handling. Fixed to PUT /books/{bookid} to ensure that a new book with the same id could not be added to the database in certain cases. Now the code ensures that the existing document will be updated. Modified the DELETE /books/{id} to also delete the associated storage container. (5 hours)

Fremonster commented 5 years ago
  1. Wiki: https://github.com/MerryFairyTalesAD440/API/wiki/All-methods----books-and--books-%7Bbookid%7D

  2. Estimated Time: 5 hours, Actual Time: 8 hours

  3. Pull request: https://github.com/MerryFairyTalesAD440/API/pull/113

  4. Bugs/Testing: https://github.com/merryfairytalesad440/api/issues/95 https://github.com/merryfairytalesad440/api/issues/100 https://github.com/merryfairytalesad440/api/issues/114

  5. Working implementations:

Get all the books: GET https://ad440-dev-function.azurewebsites.net/v1/books

Get a book by id: GET https://ad440-dev-function.azurewebsites.net/v1/books/{bookid}

Add a book (also creates a storage container for the book - the name of the containter is the book's title - all lowercase and spaces replaced with hyphens): POST https://ad440-dev-function.azurewebsites.net/v1/books

Update a book (can only update the description, author, and cover image with this function - title shouldn't change because of container): PUT https://ad440-dev-function.azurewebsites.net/v1/books/{bookid}

Delete a book (also deletes the book's storage container): DELETE https://ad440-dev-function.azurewebsites.net/v1/books/{bookid}