-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Implement an endpoint to delete a book record by ID.
User Story
Given a book exists
When I request deletion
Then the book should be removed from the database
Endpoint
DELETE /book/:id
Tasks
-
Create
DELETE /book/:idroute -
Validate
idparam -
Check if book exists
- Return
404 Not Foundif not
- Return
-
Delete record from DB
-
Return success response
-
Add Swagger documentation
- Define path param
- Add responses (200, 404)
Acceptance Criteria
- Valid ID deletes the book
- Non-existent ID returns
404 - Invalid ID returns
400 - Response confirms deletion
- Swagger UI supports testing
Testing Steps
-
Create a book
-
Copy its
id -
Send DELETE request:
/book/:id -
Verify response is
200 OK -
Run SQL query:
SELECT * FROM books WHERE id = <your_id>;
-
Confirm record no longer exists
Definition of Done
- Endpoint implemented
- Record deleted from DB
- Error handling works
- Swagger docs updated
- Code linted and formatted
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Projects
Status
Backlog