<commit_before>import React from 'react';
import request from 'superagent';

import Tasks from '../components/Tasks.jsx';

export default class TasksContainer extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      tasks: [],
    };

    this.getTasksFromServer = this.getTasksFromServer.bind(this);
  }

  componentDidMount() {
    this.getTasksFromServer();
    // setInterval(this.getTasksFromServer, this.props.pollInterval);
  }

  getTasksFromServer() {
    request
      .get('http://localhost:3000/tasks')
      .end((err, res) => {
        if (err) {
          throw err;
        }
        this.setState({ tasks: res.body });
      });
  }

  render() {
    const tasksTodo = [];
    const tasksDoing = [];
    const tasksDone = [];
    this.state.tasks.forEach((task) => {
      switch (task.status) {
        case 1:
          tasksTodo.push(task);
          break;
        case 2:
          tasksDoing.push(task);
          break;
        case 3:
          tasksDone.push(task);
          break;
        default:
          console.log('needs error handling.');
      }
    });

    return (
      <div className="column">
        <Tasks tasks={tasksTodo} label="TODO" />
        <Tasks tasks={tasksDoing} label="DOING" />
        <Tasks tasks={tasksDone} label="DONE" />
        <br />
      </div>
    );
  }
}
<commit_msg>Fixed ajax url<commit_after>import React from 'react';
import request from 'superagent';

import Tasks from '../components/Tasks.jsx';

export default class TasksContainer extends React.Component {
  constructor(props) {
    super(props);

    this.state = {
      tasks: [],
    };

    this.getTasksFromServer = this.getTasksFromServer.bind(this);
  }

  componentDidMount() {
    this.getTasksFromServer();
    // setInterval(this.getTasksFromServer, this.props.pollInterval);
  }

  getTasksFromServer() {
    request
      .get(`http://localhost:3000/tasks/date/${this.props.date}`)
      .end((err, res) => {
        if (err) {
          throw err;
        }
        this.setState({ tasks: res.body });
      });
  }

  render() {
    const tasksTodo = [];
    const tasksDoing = [];
    const tasksDone = [];
    this.state.tasks.forEach((task) => {
      switch (task.status) {
        case 1:
          tasksTodo.push(task);
          break;
        case 2:
          tasksDoing.push(task);
          break;
        case 3:
          tasksDone.push(task);
          break;
        default:
          console.log('needs error handling.');
      }
    });

    return (
      <div className="column">
        <Tasks tasks={tasksTodo} label="TODO" />
        <Tasks tasks={tasksDoing} label="DOING" />
        <Tasks tasks={tasksDone} label="DONE" />
        <br />
      </div>
    );
  }
}

{'fraction_non_alphanumeric': 0.14543486106098882, 'fraction_numerical': 0.005052327679538073, 'mean_word_length': 2.0428100987925357, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 19, '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': '3730233', 'n_tokens_mistral': 863, 'n_tokens_neox': 840, 'n_words': 162}