Who:As a developer
What:I want to update the end-point /api/favorites/add with error handlers/throw error
Why:so that I can see the difference between the correct and wrong entries of the query
Acceptance criteria
If the ((user_id && product_id)===number)=> it should show the result and status code:200,
If the ((user_id || product_id) || (user_id && product_id) ===NaN || null)=> it should show an error message with status code other than 200.
Implementation Details
Update the Post endpoint for /api/favorites/add with the required responses.
User story
Who: As a developer What: I want to update the end-point
/api/favorites/add
with error handlers/throw error Why: so that I can see the difference between the correct and wrong entries of the queryAcceptance criteria
If the ((user_id && product_id)===number)=> it should show the result and status code:200, If the ((user_id || product_id) || (user_id && product_id) ===NaN || null)=> it should show an error message with status code other than 200.
Implementation Details
Update the Post endpoint for
/api/favorites/add
with the required responses.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/