Sorry to disturb you but you can help me with logic because i failed when actually use the logic
const { createCoreController } = require(’@strapi/strapi’).factories;
module.exports = createCoreController(‘api::blog.blog’ , ({ strapi }) => ({
async create(ctx) {
// some logic here
const response = await super.create(ctx);
// some more logic
console.log(response , "response");
console.log(ctx.request.body.data.Related_Blogs);
const count = await strapi.db.query(ctx.request.body.data.Related_Blogs).count();
console.log(count, "ctx");
return response;
}
}));
Hope it helps to crack the logic