Closed ChiKaLiO closed 2 years ago
I just added the plugin and everything seemed fine until i tried to post a comment..
{ "statusCode": 400, "error": "Bad Request", "message": "{\"name\":\"Strapi:Plugin:Comments\",\"status\":400,\"message\":\"Can relate only one content type\"}" }
the post body:
{ "authorId": "2", "authorName": "Joe Doe", "authorEmail": "jdoe@sample.com", "content": "My sample response", }
plugin.js:
module.exports = { comments: { enableUsers: true, relatedContentTypes: { forum_austerities: { uuid: 'application::forum-austerity.forum-austerity', contentManager: true, __contentType: '', key: 'title', value: 'id', } } }, }
model:
.... "comments": { "plugin": "comments", "collection": "comment", "via": "related" }
@ChiKaLiO are you using v3 or v4 of Strapi?
v3
v4
V3, i'm using mongo
@ChiKaLiO I've checked your case and it seems that you didn't done the POST properly:
POST
"related": [{ "refId": 1, "ref": "forum-austerity", "field": "comments" }]
Simply the related is missing. See Readme.md
related
I just added the plugin and everything seemed fine until i tried to post a comment..
the post body:
plugin.js:
model: