Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
/**
* Challenge listing actions.
*/
import _ from 'lodash';
import { createActions } from 'redux-actions';
import { decodeToken } from 'tc-accounts';
import 'isomorphic-fetch';
import { processSRM } from 'utils/tc';
import { errors, services } from 'topcoder-react-lib';
const { fireErrorMessage } = errors;
const { getService } = services.challenge;
const { getReviewOpportunitiesService } = services.reviewOpportunities;
/**
* The maximum number of challenges to fetch in a single API call. Currently,
* the backend never returns more than 50 challenges, even when a higher limit
* was specified in the request. Thus, this constant should not be larger than
* 50 (otherwise the frontend code will miss to load some challenges).
*/
const PAGE_SIZE = 50;
/**
* The maximum number of review opportunities to fetch in a single API call.
*/
const REVIEW_OPPORTUNITY_PAGE_SIZE = 10;
/**
* Private. Loads from the backend all challenges matching some conditions.
/**
* Challenge listing actions.
*/
import _ from 'lodash';
import { createActions } from 'redux-actions';
import { decodeToken } from 'tc-accounts';
import 'isomorphic-fetch';
import { processSRM } from 'utils/tc';
import { errors, services } from 'topcoder-react-lib';
const { fireErrorMessage } = errors;
const { getService } = services.challenge;
const { getReviewOpportunitiesService } = services.reviewOpportunities;
/**
* The maximum number of challenges to fetch in a single API call. Currently,
* the backend never returns more than 50 challenges, even when a higher limit
* was specified in the request. Thus, this constant should not be larger than
* 50 (otherwise the frontend code will miss to load some challenges).
*/
const PAGE_SIZE = 50;
/**
* The maximum number of review opportunities to fetch in a single API call.
*/
const REVIEW_OPPORTUNITY_PAGE_SIZE = 1000;
/**
* Private. Loads from the backend all challenges matching some conditions.