strapi-plugin-fuzzy-search-young
Version:
Register a weighted fuzzy search endpoint for Strapi Headless CMS you can add your content types to in no time.
19 lines (18 loc) • 909 B
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const settingsService_1 = __importDefault(require("./services/settingsService"));
exports.default = ({ strapi }) => {
const settingsServ = (0, settingsService_1.default)();
const settings = settingsServ.get();
// build settings structure
const normalizedSettings = settingsServ.build(settings);
// reset plugin settings
settingsServ.set(normalizedSettings);
const hasQueryConstrains = normalizedSettings.contentTypes.find((contentType) => contentType.queryConstraints);
if (hasQueryConstrains) {
strapi.log.warn('[fuzzy-search] queryConstraints option is deprecated and removed in v2.0.0. Please use the new filters query parameter instead.');
}
};