def post(self, entity): """Starts following a user, defined by the post data""" try: post_data = json.loads(request.data) except json.JSONDecodeError as e: raise APIBadRequest(str(e)) if not post_data: raise APIBadRequest("No POST data.") follower = follow.start_following(entity, post_data) return jsonify(follower.to_json())
def post(self): """Starts following a user, defined by the post data""" return jsonify(follow.start_following(g.entity, request.json))