all repos — caroster @ a91b6c5d105a9cd70ff19ccadb8f9e2b1b00016d

[Octree] Group carpool to your event https://caroster.io

fix: :bug: Do not clear unpaid events

#584
Tim Izzo tim@5ika.ch
Mon, 02 Jun 2025 16:26:15 +0200
commit

a91b6c5d105a9cd70ff19ccadb8f9e2b1b00016d

parent

1f62e287c7c44097b6eef54345f3d9d0cd99af5a

1 files changed, 5 insertions(+), 7 deletions(-)

jump to
M backend/config/cron-tasks.tsbackend/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);