Example #1
0
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)
Example #2
0
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)