def getUserActivity(user_id): result = dao.getUserActivity(user_id) if not result: return jsonify(Error="No Activity Found"), 404 mapped_result = [] for row in result: mapped_result.append(Dict.activity_dict(row)) return jsonify(UserActivity=result)
def getAllActivity(): result = dao.getAllActivity() if not result: return jsonify(Error="No Activity Found"), 404 mapped_result = [] for row in result: mapped_result.append(Dict.activity_dict(row)) return jsonify(Activity=mapped_result)