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)
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)
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)