From 53d1b540be7fadeea8314f431f2fa517af0fdc9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tangi=20Mend=C3=A8s?= Date: Fri, 15 Mar 2024 14:13:49 +0100 Subject: [PATCH] fix: add alerte in app --- api/src/controllers/event.js | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/api/src/controllers/event.js b/api/src/controllers/event.js index fdc256d..ddff1f2 100644 --- a/api/src/controllers/event.js +++ b/api/src/controllers/event.js @@ -34,6 +34,20 @@ router.post( const appversion = Number(req.headers?.appversion ?? 0); const appdevice = req.headers?.appdevice; + if (req.body?.event?.category === "APP" && req.body?.event?.action === "APP_OPEN" && new Date() > new Date("2024-03-18")) { + return res.status(200).send({ + ok: true, + sendInApp: [ + "Information: BPCO'Mieux ne sera plus maintenue à partir du 15 avril 2024.", + "", + [ + { text: "En savoir plus", link: "https://bpcomieux.fabrique.social.gouv.fr/fin-de-service" }, + { text: "Fermer", style: "cancel" }, + ], + { cancelable: true }, + ], + }); + } return res.status(200).send({ ok: true }); }) );