<commit_before>import ActionTypes from '../actionTypes'
import { getRequest } from '../services/api'
import { UPDATE_USER_STATUS } from '../middlewares/userStatus'

export const ITEMS_PER_PAGE = 50
export const CONVERSATIONS_PER_PAGE = 500

export function fetchList(path, page = 0, params = {}) {
  let offset = page * ITEMS_PER_PAGE
  let limit = ITEMS_PER_PAGE
  const meta = {
    page,
    offset,
    limit,
  }

  let type = ActionTypes.INFINITE_LIST_INITIALIZE
  if (page > 0) {
    type = ActionTypes.INFINITE_LIST_REQUEST
  }

  const requestPath = (typeof path === 'string') ? [path] : path

  const success = {
    type: ActionTypes.INFINITE_LIST_SUCCESS,
    meta,
  }

  if (requestPath[0] === 'conversations') {
    success[UPDATE_USER_STATUS] = true

    // this is a quick hack fixing a wierd SQL issue
    offset = page * CONVERSATIONS_PER_PAGE
    limit = CONVERSATIONS_PER_PAGE
  }

  return getRequest(requestPath, { offset, limit, ...params }, {
    request: {
      type,
      meta,
    },
    success,
    failure: {
      type: ActionTypes.INFINITE_LIST_FAILURE,
      meta,
    },
  })
}

export function clearList() {
  return {
    type: ActionTypes.INFINITE_LIST_INITIALIZE,
  }
}
<commit_msg>Raise pagination limit for calendar<commit_after>import ActionTypes from '../actionTypes'
import { getRequest } from '../services/api'
import { UPDATE_USER_STATUS } from '../middlewares/userStatus'

export const ITEMS_PER_PAGE = 50
export const MANY_ITEMS_PER_PAGE = 500

export function fetchList(path, page = 0, params = {}) {
  let offset = page * ITEMS_PER_PAGE
  let limit = ITEMS_PER_PAGE
  const meta = {
    page,
    offset,
    limit,
  }

  let type = ActionTypes.INFINITE_LIST_INITIALIZE
  if (page > 0) {
    type = ActionTypes.INFINITE_LIST_REQUEST
  }

  const requestPath = (typeof path === 'string') ? [path] : path

  const success = {
    type: ActionTypes.INFINITE_LIST_SUCCESS,
    meta,
  }

  if (requestPath[0] === 'conversations') {
    success[UPDATE_USER_STATUS] = true
  }

  // this is a quick hack fixing a wierd SQL issue
  if (
    requestPath[0] === 'conversations' ||
    requestPath[0] === 'events' ||
    requestPath[0] === 'preview'
  ) {
    offset = page * MANY_ITEMS_PER_PAGE
    limit = MANY_ITEMS_PER_PAGE
  }

  return getRequest(requestPath, { offset, limit, ...params }, {
    request: {
      type,
      meta,
    },
    success,
    failure: {
      type: ActionTypes.INFINITE_LIST_FAILURE,
      meta,
    },
  })
}

export function clearList() {
  return {
    type: ActionTypes.INFINITE_LIST_INITIALIZE,
  }
}

{'fraction_non_alphanumeric': 0.11106811145510836, 'fraction_numerical': 0.007352941176470588, 'mean_word_length': 3.109697933227345, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, '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': '7640921', 'n_tokens_mistral': 901, 'n_tokens_neox': 864, 'n_words': 205}