<commit_before>import React from 'react';
import Axios from 'axios';
import { NavLink } from 'react-router-dom';
import Config from '../../../Config';

import Editor from '../../post/editor/Editor';

var options = {
    month: "short",
    day: "numeric"
};

var statusCode = {
    HIDE: -2,
    SHOW: -1,
    SENDING: 0
}

class PostManager extends React.Component {

    constructor(props) {
        super(props);
        this.openNewPost = this.openNewPost.bind(this);

        this.state = {
            data: {
                data: [],
                error: [],
            },
            status: statusCode.HIDE
        };
    }

    componentDidMount() {
        Axios.get(Config.base_url + `news`).then(response => {
            console.log(response.data);
            this.setState({data: response.data});
        });
    }

    deletePost(id) {
        console.log("Deleting post :" + id);
        Axios.delete('/post/' + id,).then(response => {
            console.log(response.data);
            //TODO remove post from state if successful
        });
    }

    openNewPost() {<commit_msg>Forgot the base url<commit_after>import React from 'react';
import Axios from 'axios';
import { NavLink } from 'react-router-dom';
import Config from '../../../Config';

import Editor from '../../post/editor/Editor';

var options = {
    month: "short",
    day: "numeric"
};

var statusCode = {
    HIDE: -2,
    SHOW: -1,
    SENDING: 0
}

class PostManager extends React.Component {

    constructor(props) {
        super(props);
        this.openNewPost = this.openNewPost.bind(this);

        this.state = {
            data: {
                data: [],
                error: [],
            },
            status: statusCode.HIDE
        };
    }

    componentDidMount() {
        Axios.get(Config.base_url + `news`).then(response => {
            console.log(response.data);
            this.setState({data: response.data});
        });
    }

    deletePost(id) {
        console.log("Deleting post :" + id);
        Axios.delete(Config.base_url + '/post/' + id,).then(response => {
            console.log(response.data);
            //TODO remove post from state if successful
        });
    }

    openNewPost() {
{'fraction_non_alphanumeric': 0.1496415770609319, 'fraction_numerical': 0.002688172043010753, 'mean_word_length': 1.8373570520965692, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, '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': '2764293', 'n_tokens_mistral': 677, 'n_tokens_neox': 671, 'n_words': 142}