VirtusLab-Open-Source / strapi-plugin-comments

A plugin for Strapi Headless CMS that provides end to end comments feature with their moderation panel, bad words filtering, abuse reporting and more.
MIT License
409 stars 64 forks source link

Delete Comment #63

Closed G1Joshi closed 3 years ago

G1Joshi commented 3 years ago

Deleting a comment is not working in strapi comment plugin, I am making a delete request with authorId in json body

URL- localhost:1337/comments/articles:1/comment:1

Body

{
    "authorId": "1",
    "authorName": "Test",
    "authorEmail": "test@gmail.com"
}

Response

{
  "statusCode": 400,
  "error": "Bad Request",
  "message": "Not provided authorId"
}

On providing authorId on query

URL- localhost:1337/comments/articles:1/comment:1?authorId=1

Response

{
  "statusCode": 500,
  "error": "Internal Server Error",
  "message": "An internal server error occurred"
}
G1Joshi commented 3 years ago

@cyp3rius Can you please look into this issue?

cyp3rius commented 3 years ago

Hi @G1Joshi , checking the scenario.

cyp3rius commented 3 years ago

Hi @G1Joshi,

I was able to reproduce your issue but it's simply a problem with url you're calling as we don't have proper documentation provided here. In the next release we will provide an update, but anyway based on DELETE specification the body is not allowed, so authorId have to be as a query param. Try please:

DELETE localhost:1337/comments/article:1/1?authorId=1

G1Joshi commented 3 years ago

Yeah, @cyp3rius it works for me :)