<commit_before>import {
  EXTENSION_RECEIVE,
} from '../action-types';

import {
  makeApiRequest,
} from '../requests/actions';


export function fetchExtension(pk) {
  return async dispatch => {
    const requestId = `fetch-extension-${pk}`;
    const extension = await dispatch(makeApiRequest(requestId, `v2/extension/${pk}/`));

    dispatch({
      type: EXTENSION_RECEIVE,
      extension,
    });
  };
}


export function fetchAllExtensions() {
  return async dispatch => {
    const requestId = 'fetch-all-extensions';
    const extensions = await dispatch(makeApiRequest(requestId, 'v2/extension/'));

    extensions.forEach(extension => {
      dispatch({<commit_msg>Fix old control's fetch action to expect pagination.<commit_after>import {
  EXTENSION_RECEIVE,
} from '../action-types';

import {
  makeApiRequest,
} from '../requests/actions';


export function fetchExtension(pk) {
  return async dispatch => {
    const requestId = `fetch-extension-${pk}`;
    const extension = await dispatch(makeApiRequest(requestId, `v2/extension/${pk}/`));

    dispatch({
      type: EXTENSION_RECEIVE,
      extension,
    });
  };
}


export function fetchAllExtensions() {
  return async dispatch => {
    const requestId = 'fetch-all-extensions';
    const extensions = await dispatch(makeApiRequest(requestId, 'v2/extension/'));

    extensions.results.forEach(extension => {
      dispatch({
{'fraction_non_alphanumeric': 0.1363311920057102, 'fraction_numerical': 0.0028551034975017845, 'mean_word_length': 3.8013698630136985, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '7656804', 'n_tokens_mistral': 415, 'n_tokens_neox': 407, 'n_words': 90}