Ok, I switch my node version from v15.1 to v14.15.1. (nvm
). Unfortunately, it doesn’t solve the actual issue but it can surely improve stability.
For my query, I did not change it. It’s the default find query.
I don’t know if it can help, but here is my controller :
/api/controllers/events.js
"use strict";
const { sanitizeEntity } = require("strapi-utils");
module.exports = {
async find(ctx) {
let entities;
if (ctx.query._q) {
entities = await strapi.services.events.search(ctx.query);
} else {
entities = await strapi.services.events.find(ctx.query);
}
return entities
.map(entity => {
const event = sanitizeEntity(entity, { model: strapi.models.events });
const formattedEvent = [];
event.event_iteration.forEach(iteration => {
formattedEvent.push({
event_name: event.event_name,
event_id: event.id,
created_at: event.created_at,
iteration_name: iteration.name,
illustration: iteration.illustration
});
});
return formattedEvent;
})
.flat();
}
};