Can we maybe have an answer from the staff ?
Because I really don’t understand why adding these complexe structure with attributes and data…
And it’s on purpose, because if we didn’t use the transformResponse function, there is not data…
//Override find examples :
async find(ctx) {
await this.validateQuery(ctx);
const sanitizedQueryParams = await this.sanitizeQuery(ctx);
const { results, pagination } = await strapi
.service("api::activity.activity")
.find(sanitizedQueryParams);
const sanitizedResults = await this.sanitizeOutput(results, ctx);
// transformResponse add attributes....
return this.transformResponse(sanitizedResults, { pagination });
//--> Output with attributes
//Custom return without any attributes
const activitiesMeta = {
data: sanitizedResults,
meta: pagination,
};
return activitiesMeta;