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

Relation for field related does not exist. Check your payload please. #215

Closed giorgosn closed 1 year ago

giorgosn commented 1 year ago

I am doing this post request: { "author": { "id": "1", "name": "Joe Doe", "email": "jdoe@sample.com" }, "content": "My sample response" }

and I am getting this error as a responce: { "data": null, "error": { "status": 400, "name": "BadRequestError", "message": "{\"status\":400,\"name\":\"Strapi:Plugin:Comments\",\"message\":\"Relation for field \\"related\\" does not exist. Check your payload please.\"}" } }

Can someone help me on what I am doin wrong?

JeremyMCastillo commented 1 year ago

Based on where the error message comes from, it seems like the issue may be with the endpoint you are using. From the documentation, endpoints should be formatted like this:

POST <host>/api/comments/api::<collection name>.<content type name>:<entity id>

This error is triggered when the <content type name> is not associated with the <collection name>. Make sure you're trying to post a comment to a valid Collection Type, and that your URL is formatted correctly.

cyp3rius commented 1 year ago

Closing because no feedback from reporter.