diff --git a/README.md b/README.md index e0cba33..a2e74ba 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ The populate deep option is available for all collections and single types using # Configuration -The default depth and behaviour for populating creator fields can be customized via the plugin config. To do so create or edit you plugins.js file. +The default depth can be customized via the plugin config. To do so create or edit you plugins.js file. ## Example configuration @@ -40,11 +40,9 @@ The default depth and behaviour for populating creator fields can be customized ``` module.exports = ({ env }) => ({ - 'populate-deep': { - enabled: true, + 'strapi-plugin-populate-deep': { config: { defaultDepth: 3, // Default is 5 - skipCreatorFields: false, // Default is true } }, }); diff --git a/server/bootstrap.js b/server/bootstrap.js index b813824..6d8a0e9 100644 --- a/server/bootstrap.js +++ b/server/bootstrap.js @@ -6,7 +6,7 @@ module.exports = ({ strapi }) => { strapi.db.lifecycles.subscribe((event) => { if (event.action === 'beforeFindMany' || event.action === 'beforeFindOne') { const populate = event.params?.populate; - const defaultDepth = strapi.plugin('populate-deep')?.config('defaultDepth') || 5 + const defaultDepth = strapi.plugin('strapi-plugin-populate-deep')?.config('defaultDepth') || 5 if (populate && populate[0] === 'deep') { const depth = populate[1] ?? defaultDepth diff --git a/server/helpers/index.js b/server/helpers/index.js index dead7a5..038c1e8 100644 --- a/server/helpers/index.js +++ b/server/helpers/index.js @@ -1,6 +1,6 @@ const { isEmpty, merge } = require("lodash/fp"); -const skipCreatorFields = strapi.plugin('populate-deep')?.config('skipCreatorFields') || true; +const skipCreatorFields = strapi.plugin('strapi-plugin-populate-deep')?.config('skipCreatorFields') || true; const getModelPopulationAttributes = (model) => { if (model.uid === "plugin::upload.file") {