Open niss3n opened 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)
Wiki: https://github.com/MerryFairyTalesAD440/API/wiki/All-methods----books-and--books-%7Bbookid%7D
Estimated Time: 5 hours, Actual Time: 8 hours
Pull request: https://github.com/MerryFairyTalesAD440/API/pull/113
Bugs/Testing: https://github.com/merryfairytalesad440/api/issues/95 https://github.com/merryfairytalesad440/api/issues/100 https://github.com/merryfairytalesad440/api/issues/114
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}
Created draft of the GET books/{bookid} function and deployed it to my testing resource. (1 hour)