delete alert from db after sending
This commit is contained in:
parent
bae24bbb94
commit
527bf3662c
|
@ -156,10 +156,7 @@ const handleAlert = async (alert: any, db: any) => {
|
||||||
message += "\nVisit: https://trade.mango.markets/"
|
message += "\nVisit: https://trade.mango.markets/"
|
||||||
const alertSent = await sendAlert(alert, message)
|
const alertSent = await sendAlert(alert, message)
|
||||||
if (alertSent) {
|
if (alertSent) {
|
||||||
db.collection("alerts").updateOne(
|
db.collection("alerts").deleteOne({ _id: alert._id })
|
||||||
{ _id: new ObjectId(alert._id) },
|
|
||||||
{ $set: { open: false, triggeredTimestamp: Date.now() } }
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
|
|
Loading…
Reference in New Issue