Delete product from database.
URL : /api/products/:id
URL parameter: id=[string]
where id
is mongoose object id syntax.
Method: DELETE
Code: 204 No content
Condition: If product with provided correctly id exists.
No content.
Code: 400 BAD REQUEST
Condition: If provided id has incorrect type.
{ "id": "Provided id is incorrect" }
Code: 400 BAD REQUEST
Condition: If product with provided id doesn't exist.
{ "id": "Product with provided id doesn't exist" }
Code: 400 BAD REQUEST
Condition: If no id provided.
{ "id": "No id provided" }