def reactions(uid, cid, mid): if request.method == 'POST': return ReactionsHandler().insert_reaction(request.form, uid, mid) elif request.method == 'GET': return ReactionsHandler().getReactions() else: return jsonify(Error="Method not allowed"), 405
def reactionsById(uid, cid, mid, rid): if request.method == 'GET': return ReactionsHandler().getReactionById(rid) elif request.method == 'PUT': return ReactionsHandler().updateReactionById(rid, request.form) elif request.method == 'DELETE': return ReactionsHandler().deleteReactionsById(rid) else: return jsonify(Error='Method Not Allowed'), 405
def daily_dislikes(): if request.method == 'GET': return ReactionsHandler().get_total_dislikes_per_day() else: return jsonify(Error='Method Not Allowed')
def users_disliked(uid, cid, mid): if request.method == 'GET': return ReactionsHandler().get_users_that_disliked(mid) else: return jsonify(Error='Method Not Allowed'), 405
def dislikes_by_mid(uid, cid, mid): if request.method == 'GET': return ReactionsHandler().get_number_of_dislikes(mid) else: return jsonify(Error='Method Not Allowed'), 405
def total_message_dislikes(mid): if request.method == 'GET': return ReactionsHandler().get_number_of_dislikes(mid) else: return jsonify(Error='Method Not Allowed'), 405
def reactions_by_id(mid, uid): if request.method == 'GET': return ReactionsHandler().get_user_reaction(mid, uid) else: return jsonify(Error="Method not allowed"), 405
def allReactions(): if request.method == 'POST': return ReactionsHandler().insertReactionToMsg(request.get_json()) elif request.method == 'GET': if request.args: return ReactionsHandler().getAllReactionsFor(request.args)
def allMessagesDislikes(mid): return ReactionsHandler().getAllMessageDislikes(mid)
def allMessagesLikes(mid): return ReactionsHandler().getAllMessageLikes(mid)
def numDislikesFromUser(id): return ReactionsHandler().getNumberOfDislikes(id)
def dislikesFromUser(id): return ReactionsHandler().getAllUserDislikes(id)
def likesFromUser(id): return ReactionsHandler().getAllUserLikes(id)