From 36b564bf9bf7f6227b7e56ac26b2432d1c9c336b Mon Sep 17 00:00:00 2001 From: ChrisChrome Date: Fri, 30 Aug 2024 15:03:48 -0600 Subject: [PATCH] Add cooldown msg --- index.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 2b72436..c0cacdc 100644 --- a/index.js +++ b/index.js @@ -654,7 +654,10 @@ app.post("/api/v1/webhook/:brand/:accountNumber", (req, res) => { } else { // send alert to accountNumber - sendAlert(req.params.accountNumber, req.body.transaction, req.body.placeName, req.body.systemName, req.body.zoneNumber, req.body.zoneName, req.body.event).then(() => { + sendAlert(req.params.accountNumber, req.body.transaction, req.body.placeName, req.body.systemName, req.body.zoneNumber, req.body.zoneName, req.body.event).then((resp) => { + if(resp == "Cooldown") { + return res.status(429).send("Cooldown"); + } res.status(204).send(); }).catch((error) => { res.status(500).send(error);