Update app.py
Browse files
app.py
CHANGED
|
@@ -94,12 +94,7 @@ def background_price_checker():
|
|
| 94 |
"current_price": current_price,
|
| 95 |
"price_str": price_str
|
| 96 |
}
|
| 97 |
-
|
| 98 |
-
if triggered == 0:
|
| 99 |
-
update_fields["triggered"] = 1
|
| 100 |
-
else:
|
| 101 |
-
if triggered != 0:
|
| 102 |
-
update_fields["triggered"] = 0
|
| 103 |
|
| 104 |
watchlist_col.update_one({"_id": app_id}, {"$set": update_fields})
|
| 105 |
except Exception as e:
|
|
@@ -213,8 +208,6 @@ def check_alerts():
|
|
| 213 |
|
| 214 |
@app.route('/api/dismiss', methods=['POST'])
|
| 215 |
def dismiss_alert():
|
| 216 |
-
app_id = request.json.get('app_id')
|
| 217 |
-
watchlist_col.update_one({"_id": app_id}, {"$set": {"triggered": 2}})
|
| 218 |
return jsonify({"status": "success"})
|
| 219 |
|
| 220 |
if __name__ == '__main__':
|
|
|
|
| 94 |
"current_price": current_price,
|
| 95 |
"price_str": price_str
|
| 96 |
}
|
| 97 |
+
update_fields["triggered"] = is_triggered
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 98 |
|
| 99 |
watchlist_col.update_one({"_id": app_id}, {"$set": update_fields})
|
| 100 |
except Exception as e:
|
|
|
|
| 208 |
|
| 209 |
@app.route('/api/dismiss', methods=['POST'])
|
| 210 |
def dismiss_alert():
|
|
|
|
|
|
|
| 211 |
return jsonify({"status": "success"})
|
| 212 |
|
| 213 |
if __name__ == '__main__':
|