()
| 14 | |
| 15 | @app.route("/new_notification", methods=["POST"]) |
| 16 | def new_notification(): |
| 17 | data = request.json |
| 18 | if not data or "title" not in data or "message" not in data: |
| 19 | return jsonify({"error": "Missing title or message"}), 400 |
| 20 | |
| 21 | notif = { |
| 22 | "title": data["title"], |
| 23 | "message": data["message"], |
| 24 | "timestamp": time.time(), |
| 25 | "reminder_time": data.get("reminder_time") |
| 26 | } |
| 27 | _notifications.append(notif) |
| 28 | return jsonify(notif), 201 |
| 29 | |
| 30 | @app.route("/list_notifications", methods=["GET"]) |
| 31 | def list_notifications(): |
nothing calls this directly
no outgoing calls
no test coverage detected