<commit_before>/**
 *
 * @flow
 */
'use strict';

import React from 'react';
import TaskListView from './TaskListView';
import type {Task} from '../../reducers/tasks';

const educhain = 'http://192.168.99.100:8082'; // TODO configure as global

export default class TaskListContainer extends React.Component {
    state: {
        tasks: Array<Task>
    };

    constructor() {
        super();
        this.state = {
            tasks: []
        };
    }

    async getAllTasks(): Promise {
        try {
            let response = await fetch(educhain+'/tasks');
            let responseJSON = await response.json();
            return responseJSON.data;
        } catch (err) {
            console.error("Error @ getAllTasks(): ", err);
        }
    }

    componentWillMount() {
        let testRows = () => {
            let arr = [];
            let flip = false;
            for (let i = 0; i < 20; i++) {
                arr.push({
                    id: `${i}`,
                    title: `Task ${i}`,
                    desc: `desc for task ${i}`,
                    reward: '200',
                    complete: '3/5',
                    status: flip ? 'To Do' : 'Completed',
                    address: "asdasdadasdas"
                });
                flip = !flip;<commit_msg>Keeps error message format uniform<commit_after>/**
 *
 * @flow
 */
'use strict';

import React from 'react';
import TaskListView from './TaskListView';
import type {Task} from '../../reducers/tasks';

const educhain = 'http://192.168.99.100:8082'; // TODO configure as global

export default class TaskListContainer extends React.Component {
    state: {
        tasks: Array<Task>
    };

    constructor() {
        super();
        this.state = {
            tasks: []
        };
    }

    async getAllTasks(): Promise {
        try {
            let response = await fetch(educhain+'/tasks');
            let responseJSON = await response.json();
            return responseJSON.data;
        } catch (err) {
            console.error("getAllTasks() -> Error: ", err);
        }
    }

    componentWillMount() {
        let testRows = () => {
            let arr = [];
            let flip = false;
            for (let i = 0; i < 20; i++) {
                arr.push({
                    id: `${i}`,
                    title: `Task ${i}`,
                    desc: `desc for task ${i}`,
                    reward: '200',
                    complete: '3/5',
                    status: flip ? 'To Do' : 'Completed',
                    address: "asdasdadasdas"
                });
                flip = !flip;
{'fraction_non_alphanumeric': 0.13941940412528647, 'fraction_numerical': 0.01757066462948816, 'mean_word_length': 1.393967093235832, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 8, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 2, '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': '6531965', 'n_tokens_mistral': 753, 'n_tokens_neox': 695, 'n_words': 193}