hngprojects / hng_boilerplate_nestjs

Description
Apache License 2.0
182 stars 105 forks source link

[FEAT] Update Comment in the Blog section by the User(Creator of comment) #191

Closed githukueliud closed 1 month ago

githukueliud commented 1 month ago

Description

An API endpoint to enable users to update their comments in the Blog comment section. The endpoint ensures a user can update their comment in the blog section at will. The endpoint should at first ensure that the comment exists. The endpoint should also be protected, and ensure that the user that is logged in is the owner of the said comment.


Models Involved


Acceptance Criteria


Endpoint

Description: Update the content of the About page.
Endpoint: PUT /api/v1/about
Authentication: Required
Authorization: Creators of resource(comment) only
Request Body:

{
  "comment_body": "string"
}

Response

{
  "message": "comment field must be provided",
  "status": "unsuccessful",
  "status_code": 400
}
{
  "message": "comment not found",
  "status": "unsuccessful",
  "status_code": 404
 }

Purpose

Provides a secure backend service that allows users to update their comments in the blog section.


Requirements


Expected Outcome


Tasks

Testing

markessien commented 1 month ago

Comments are not tied to any model

markessien commented 1 month ago

issue not fixed