Skip to content

Latest commit

 

History

History
47 lines (27 loc) · 719 Bytes

delete.md

File metadata and controls

47 lines (27 loc) · 719 Bytes

Delete product

Description

Delete product from database.

URL : /api/products/:id

URL parameter: id=[string] where id is mongoose object id syntax.

Method: DELETE

Success Response

Code: 204 No content

Condition: If product with provided correctly id exists.

Context example

No content.

Error Response

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" }