@@ -9,17 +9,23 @@ module.exports = ({ strapi }) => {
99
1010 // Only proceed for 'beforeFindMany' or 'beforeFindOne' actions.
1111 if ( action === 'beforeFindMany' || action === 'beforeFindOne' ) {
12- const { customPopulate, customDepth } = params || { } ;
12+ const { customPopulate, customDepth, customIgnored } = params || { } ;
1313
1414 // Get the default depth from plugin config, fallback to 5 if undefined.
1515 const defaultDepth = strapi
1616 . plugin ( 'strapi-plugin-nested-populator' )
1717 ?. config ( 'defaultDepth' ) || 5 ;
1818
19+ // Get the default ignored list from plugin config, fallback to empty array if undefined.
20+ const defaultIgnored = strapi
21+ . plugin ( 'strapi-plugin-nested-populator' )
22+ ?. config ( 'ignore' ) || [ ] ;
23+
1924 // Apply population logic if 'nested' population is requested.
2025 if ( customPopulate === 'nested' ) {
2126 const depth = customDepth > 0 ? customDepth : defaultDepth ;
22- const modelObject = buildPopulateTree ( model . uid , depth , [ ] ) ;
27+ const ignored = customIgnored || defaultIgnored ;
28+ const modelObject = buildPopulateTree ( model . uid , depth , ignored ) ;
2329
2430 // Update the event params with the computed population object.
2531 params . populate = modelObject . populate ;
0 commit comments