Add cooldown msg

This commit is contained in:
Christopher Cookman 2024-08-30 15:03:48 -06:00
parent 6de6dd8f05
commit 36b564bf9b
Signed by: ChrisChrome
GPG key ID: A023A26E42C33A42

View file

@ -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);