hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] Comment Deletion Endpoint #165

Closed sirlawglobal closed 2 months ago

sirlawglobal commented 3 months ago

Description

Implement an endpoint that deletes a comment(s) from a post, and ensures error handling and safe deletion of the data.

Acceptance Criteria

Endpoint

Authentication

Response Handling.

Endpoint Example

DELETE /api/v1/comments/:comment_id
Content-Type: application/json
Authorization: Bearer <token>

Expected Successful Response


{
  "message": "Comment successfully deleted",
  "status_code": 204
}

Expected Error Responses


{
  "message": "Comment Not Found",
  "error": "Invalid comment Id" 
  "status_code": 404
}

{
  "message": "Unable to delete comment",
  "error": "Unauthorized user" 
  "status_code": 401
}

Purpose

A feature which allows for deletion of comments on a post.

Requirements

Expected Outcome

The endpoint should delete a user's comments from a post.

Unit Testing

Participants Slack_id:

@Agnes Kariuki, fastApi @Michelle Ndiangui , laravel @akanji Lawrence, nodejs

markessien commented 3 months ago

comments are standalone and not under user

sirlawglobal commented 3 months ago

Endpoint and response payload adjusted , Header authentication and Testing added.

All these have been fixed . Need mentor review.

@markessien pls help us look into this..

highb33kay commented 3 months ago

Mark needs to review first

sirlawglobal commented 3 months ago

@highb33kay @Ameenah-Ameenah @highb33kay @prondubuisi

Please we need second approval!