<commit_before>import * as types from './constants';
// import 'whatwg-fetch';
import fetch from 'isomorphic-fetch';
const baseUrl = 'https://udacity-alumni-api.herokuapp.com/';
const articleUrl = `${baseUrl}api/v1/articles/id`;

// singlePostdefaultAction :: None -> {Action}
export const singlePostDefaultAction = () => ({
  type: types.SINGLEPOST_DEFAULT_ACTION,
});
// loadArticleInitiation :: None -> {Action}
export const loadArticleInitiation = () => ({
  type: types.ARTICLE_INITIATION,
});

// loadArticleSuccess :: JSON -> {Action}
export const loadArticleSuccess = (article) => ({
  type: types.ARTICLE_SUCCESS,
  article,
});

// loadArticleFailure :: Err -> {Action}
export const loadArticleFailure = (errors) => ({
  type: types.ARTICLE_FAILURE,
  errors,
});

export const loadArticle = () =>
  (dispatch) => {
    dispatch(
      loadArticleInitiation()
    );
    fetch(articleUrl)
      .then(res => res.json())
      .then(res => res.article)
      .then(article => {
        dispatch(
          loadArticleSuccess(article)
        );
      }).catch(error =>
        dispatch(
          loadArticleFailure([error])<commit_msg>Fix: url<commit_after>import * as types from './constants';
import 'whatwg-fetch';
// import fetch from 'isomorphic-fetch';
const baseUrl = 'https://udacity-alumni-api.herokuapp.com/';
const articleUrl = (id) => `${baseUrl}api/v1/articles/${id}`;

// singlePostdefaultAction :: None -> {Action}
export const singlePostDefaultAction = () => ({
  type: types.SINGLEPOST_DEFAULT_ACTION,
});
// loadArticleInitiation :: None -> {Action}
export const loadArticleInitiation = () => ({
  type: types.ARTICLE_INITIATION,
});

// loadArticleSuccess :: JSON -> {Action}
export const loadArticleSuccess = (article) => ({
  type: types.ARTICLE_SUCCESS,
  article,
});

// loadArticleFailure :: Err -> {Action}
export const loadArticleFailure = (errors) => ({
  type: types.ARTICLE_FAILURE,
  errors,
});

export const loadArticle = (id) =>
  (dispatch) => {
    dispatch(
      loadArticleInitiation()
    );
    fetch(articleUrl(id))
      .then(res => res.json())
      .then(res => res.article)
      .then(article => {
        dispatch(
          loadArticleSuccess(article)
        );
      }).catch(error =>
        dispatch(
          loadArticleFailure([error])
{'fraction_non_alphanumeric': 0.15986099044309296, 'fraction_numerical': 0.0008688097306689834, 'mean_word_length': 3.445945945945946, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 32, 'https://': 2, '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': '2488164', 'n_tokens_mistral': 717, 'n_tokens_neox': 700, 'n_words': 142}