示例#1
0
def getAllLikes():
    rows = dao.getAllLikes()
    if not rows:
        return jsonify(Error="No reaction"), 404
    result = []
    for row in rows:
        result.append(Dic.build_reacted_dict(row))
    return jsonify(Reacts=result)
示例#2
0
def getUserReactions(uID):
    result = dao.getAllReactionsByUser(uID)
    if not result:
        return jsonify(Error="No Reactions Found")
    mapped_result = []
    for r in result:
        mapped_result.append(Dic.build_reacted_dict(r))
    return jsonify(UserReactions=mapped_result)
示例#3
0
def getAllReactionsInMessage(mID):
    # This method return the reaction of a determined message
    rows = dao.getAllReactionsInMessage(mID)
    if not rows:
        return jsonify(Error="Message does not contain reaction"), 404
    result = []
    for row in rows:
        result.append(Dic.build_reacted_dict(row))
    return jsonify(Reaction=result)