Lifecycles can handle its child component data also by a hack in strapi

suppose if we are using strapi api and inside it we are using its components then in lifecycles.js we cant get the components data but by this we can access the inside data of components also

const { ApplicationError, ForbiddenError} = require(“@strapi/utils”).errors;
module.exports = {
async beforeCreate(event) {
const { result, params, model } = event;
console.log(‘params’,JSON.stringify(params))
const topic_arr=params.data.Topic.map(x=>x.id);
console.log(‘topic_arr’,topic_arr);
const Topic = await strapi.db.query(‘topic.learn-topic’).findMany({
where: { id: {$in:topic_arr} },
populate: {
‘Chapter’: {
populate: {
‘Quiz’: {
populate:{‘question_banks’:true}
}
},
}
}
});
console.log(‘Topic’,JSON.stringify(Topic));

here there was a course table inside which there was a topic component and inside the topic there was more components about 3 components inside it
and populate over the params.data was not possible so we found a new way firstly we get the topic ids the we wrote the query for findMany over it so that we can populate as much as we want inside lifecycles