fix: :bug: Do not clear unpaid events #584
Tim Izzo tim@5ika.ch
Mon, 02 Jun 2025 16:26:15 +0200
1 files changed,
5 insertions(+),
7 deletions(-)
jump to
M
backend/config/cron-tasks.ts
→
backend/config/cron-tasks.ts
@@ -45,13 +45,11 @@ * Every sunday at 02:00
*/ "0 2 * * 0": async ({ strapi }) => { try { - const { count } = await strapi.entityService.deleteMany( - "api::event.event", - { - filters: { unpaid: { $eq: true } }, - } - ); - strapi.log.info(`${count} unpaid events deleted`); + const { count } = await strapi.db.query("api::event.event").updateMany({ + where: { unpaid: true }, + data: { unpaid: false, enabled_modules: [] }, + }); + strapi.log.info(`${count} unpaid events reset to basic.`); } catch (error) { strapi.log.error(`Can't delete unpaid events`); console.error(error);