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

How to customize/override the some functions of the plugin? #60

Closed loongmxbt closed 3 years ago

loongmxbt commented 3 years ago

I followed up the strapi plugin guide on how to override. I've copied the original functions.js to /extensions/comments/services/utils/functions.js, and tried to modify checkBadWords function. But nothing changes. Is override only apply to default strapi plugins? How can I override checkBadWords function? Thanks for help!

cyp3rius commented 3 years ago

@loongmxbt I think you've to extend also the service file to use your new function. Strapi is supporting auto extensions only for the core files of services, controllers etc. All that is in addition (like this util) is not supported by default.

Just extend the service file and use your updated function. That should work.