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
405 stars 63 forks source link

Can't hit a plugin entity #121

Closed Louai99k closed 2 years ago

Louai99k commented 2 years ago

I tried the plugin it worked just fine for me but I noticed that I can't hit the user entity from users-permissions plugin and it's just made for api content types so is that a bug or it's just how this plugin work?

cyp3rius commented 2 years ago

Hello @Louai99k ,

If I got you correctly you want to fetch all comments per user. Am I right? If yes, plugin is not strictly connected with User entity and such functionality might be useful separated endpoint like api/comments/user or api/comments/user/<id>. Should be easy to do.

Louai99k commented 2 years ago

No I actually want to post a comment direct to the user content type from the users-permissions plugin like POST http://localhost:1337/api/comments/plugin::users-permissions.user:

cyp3rius commented 2 years ago

As for now it's possible to post comments only against api:: like collections which by nature are "content like". Without such rule also 'roles' entities are going to be available what is a bit tricky.

Louai99k commented 2 years ago

Can I try to add this feature then make a PR?

cyp3rius commented 2 years ago

I'm not seeing working with built in collections as a feature on our roadmap. I would suggest you to make an extension to the plugin service using Strapi Extensions concept.

Louai99k commented 2 years ago

Ok I will. When you are not enabling any comments in the comments only for settings you should be able to commit to the all content types that you have but instead you got an error and you can't comment to any content type unless it has been added in that settings so I'm trying to fix it.

cyp3rius commented 2 years ago

Comments are working against collections exposed and configured via Settings page so its indeed as you described. Plugin works for what is set via dedicated page, and it contains as available only api:: like collections.