<commit_before>import { API_URL } from '../constants/networking';

export function setCurrentUrl(url) {
  return (dispatch, getState) => {
    const currentPage = getState().visitingPage.currentPage;

    if (url !== currentPage) {
    // We have change paged, now we have to see information from that paged

      fetch(`${API_URL}/articles?url=${encodeURIComponent(url)}`, {
        method: 'GET',
      }).then(res => res.json())
      .then((res) => {
        dispatch({
          type: 'SET_CURRENT_URL',
          payload: {
            url,
            canVote: res.can_vote,
            numVotes: res.num_votes,
          },
        });
      });
    }
  };
}

export function setBullshitPercentage(percentage) {
  return {
    type: 'SET_BULLSHIT_PERCENTAGE',
    payload: {
      bullshitPercentage: percentage,
    },
  };
}

export function getCurrentArticleData() {
  return (dispatch) => {
    const reply = {
      article: {
      url: 'http://loquesea/',
      bs_index: 80,
      },
      num_votes: num_votes,
      // can_vote: !!user&.can_vote_article?(article)
    };
  };
}
<commit_msg>fix get article user query params<commit_after>import { API_URL } from '../constants/networking';

export function setCurrentUrl(url) {
  return (dispatch, getState) => {
    const currentPage = getState().visitingPage.currentPage;

    if (url !== currentPage) {
    // We have change paged, now we have to see information from that paged

      fetch(`${API_URL}/articles?url=${encodeURIComponent(url)}&user[id]=&user[authentication_token]=`, {
        method: 'GET',
      }).then(res => res.json())
      .then((res) => {
        dispatch({
          type: 'SET_CURRENT_URL',
          payload: {
            url,
            canVote: res.can_vote,
            numVotes: res.num_votes,
          },
        });
      });
    }
  };
}

export function setBullshitPercentage(percentage) {
  return {
    type: 'SET_BULLSHIT_PERCENTAGE',
    payload: {
      bullshitPercentage: percentage,
    },
  };
}

export function getCurrentArticleData() {
  return (dispatch) => {
    const reply = {
      article: {
      url: 'http://loquesea/',
      bs_index: 80,
      },
      num_votes: num_votes,
      // can_vote: !!user&.can_vote_article?(article)
    };
  };
}

{'fraction_non_alphanumeric': 0.14235500878734622, 'fraction_numerical': 0.0017574692442882249, 'mean_word_length': 2.3683431952662723, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 11, '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': '7120158', 'n_tokens_mistral': 737, 'n_tokens_neox': 732, 'n_words': 143}