Who:As a developer
What:I want to update the endpoint /api/products/on_discount in products.controller.js and products.router.js with the error handlers/ throw errors.
Why:so that I can have the error message and status code on getting errors
Acceptance criteria
Response code 200 for successful query and 400/404/500 for failed query
Implementation Details
Update the Get endpoint /api/products/on_discount with the error handling.
User story
Who: As a developer What: I want to update the endpoint
/api/products/on_discount
inproducts.controller.js
andproducts.router.js
with the error handlers/ throw errors. Why: so that I can have the error message and status code on getting errorsAcceptance criteria
Response code 200 for successful query and 400/404/500 for failed query
Implementation Details
Update the Get endpoint
/api/products/on_discount
with the error handling.Read about Swagger here https://github.com/HackYourFuture-CPH/fp-class18/#-working-with-api-documentation---swagger and this article should also help you with that https://blog.logrocket.com/documenting-your-express-api-with-swagger/