Version : 4.1.12
Node : (node v14.19.1)
Edition: Community
Can you describe your problem in deep? please.
Hey Luis, i found a solution thank you for reaching out!
I was struggling to add locales to the query with populate=deep to get access to the dynamic zones.
can you write your solution here, please?
It can be useful for other people with the same problem.
"use strict";
/**
* food-and-drinks-page controller
*/
const { createCoreController } = require("@strapi/strapi").factories;
module.exports = createCoreController(
"api::food-and-drinks-page.food-and-drinks-page",
({ strapi }) => ({
async find(ctx) {
const { query } = ctx;
const entity = await strapi.entityService.findMany(
"api::food-and-drinks-page.food-and-drinks-page",
{
...query,
populate: "deep",
}
);
const sanitizedEntity = await this.sanitizeOutput(entity, ctx);
return this.transformResponse(sanitizedEntity);
},
})
);
OR
http://localhost:1337/api/home-page?populate=deep&?locale=es
So, it means you have to add this code to your controllers, right?