bkarimii / Coursework-Planner

Your coursework planner
1 stars 0 forks source link

Delete videos endpoint #291

Open bkarimii opened 3 months ago

bkarimii commented 3 months ago

From Full-Stack-Project-Assessment created by Dedekind561: CodeYourFuture/Full-Stack-Project-Assessment#467

Description

HTTP Method: DELETE

Route: /api/videos/{id}

This endpoint is used to delete a specific video from the database. DELETE endpoints don't require a request body, and they don't even need to return a response body! While you can return a confirmation message: however, if you don't want to, you can use the HTTP status code 204 to tell the client that the action was successful, but there is no response body.

To make the endpoint nicer, you can also change it so if you try to call this endpoint on an id that doesn't exist, the system may respond with a HTTP 404 status code designating that the video did not exist in the first place or was already deleted.

Acceptance Criteria