Skip to content
This repository has been archived by the owner on May 13, 2024. It is now read-only.

Commit

Permalink
fix: add alerte in app
Browse files Browse the repository at this point in the history
  • Loading branch information
tangimds committed Mar 15, 2024
1 parent 35e2c50 commit 53d1b54
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions api/src/controllers/event.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 });
})
);
Expand Down

0 comments on commit 53d1b54

Please sign in to comment.