def message_delete(hash_id): message = Message.get_or_404(hash_id) Message.query.filter_by(id=message.id).delete() db.session.commit() return jsonify(True)
def mark_as_read(hash_id): message = Message.get_or_404(hash_id) message.unread = False db.session.add(message) db.session.commit() return jsonify(True)