<commit_before>var CommentForm = React.createClass({
  propTypes: {
    campus_id: React.PropTypes.number,
    room_id: React.PropTypes.number,
    event_id: React.PropTypes.number
  },

  getInitialState: function () {
    return {
      commentText: ''
    };
  },
  handleChange: function (event) {
    this.setState({
      commentText: event.target.value
    });
  },

  handlePostComment: function () {
    var that = this;
    $.ajax({
      method: "POST",
      url: "/comments",
      data: {
        comment: {
          body: this.state.commentText,
          campus_id: this.props.campus_id,
          room_id: this.props.room_id,
          event_id: this.props.event_id
        }
      }
    }).done(function(response){
      console.log(response);
      that.setState({
        commentText: ''
      });
    });
  },

  render: function(){
    return (
      <div className="container">
        <label><strong>New Comment: </strong>
          <textarea row={40} cols={40}
                 className="form-control-100"
                 placeholder="<NAME>"
                 value={this.state.commentText}
                 onChange={this.handleChange}/>
        </label><br/>
        <label>
          <input type="button"
                 className="btn btn-primary"
                 value="Post Comment"
                 onClick={this.handlePostComment} />
        </label>
      </div>
    );

  }
});
<commit_msg>changed comments ajax request to specify json response<commit_after>var CommentForm = React.createClass({
  propTypes: {
    campus_id: React.PropTypes.number,
    room_id: React.PropTypes.number,
    event_id: React.PropTypes.number
  },

  getInitialState: function () {
    return {
      commentText: ''
    };
  },
  handleChange: function (event) {
    this.setState({
      commentText: event.target.value
    });
  },

  handlePostComment: function () {
    var that = this;
    $.ajax({
      method: "POST",
      url: "/comments.json",
      data: {
        comment: {
          body: this.state.commentText,
          campus_id: this.props.campus_id,
          room_id: this.props.room_id,
          event_id: this.props.event_id
        }
      }
    }).done(function(response){
      console.log(response);
      that.setState({
        commentText: ''
      });
    });
  },

  render: function(){
    return (
      <div className="container">
        <label><strong>New Comment: </strong>
          <textarea row={40} cols={40}
                 className="form-control-100"
                 placeholder="<NAME>"
                 value={this.state.commentText}
                 onChange={this.handleChange}/>
        </label><br/>
        <label>
          <input type="button"
                 className="btn btn-primary"
                 value="Post Comment"
                 onClick={this.handlePostComment} />
        </label>
      </div>
    );

  }
});

{'fraction_non_alphanumeric': 0.13592567102546455, 'fraction_numerical': 0.004817618719889883, 'mean_word_length': 1.814133591481123, 'pattern_counts': {'":': 0, '<': 27, '<?xml version=': 0, '>': 27, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4148766', 'n_tokens_mistral': 851, 'n_tokens_neox': 843, 'n_words': 147}