コード例 #1
0
    def post(cls, relation_id, task_id):
        """
        Creates a new task comment.
        """

        data = request.json

        is_valid = validate_task_comment_request_data(data)
        if is_valid != {}:
            return is_valid, HTTPStatus.BAD_REQUEST

        comment = data["comment"]
        return TaskCommentDAO.create_task_comment(get_jwt_identity(), task_id,
                                                  relation_id, comment)
コード例 #2
0
 def create_task_comment():
     dao = TaskCommentDAO()
     dao.create_task_comment(user_id=1,
                             task_id=1,
                             relation_id=2,
                             comment="comment")