Sha256: 5773b75c4ac93b90b2a614290304bdfd05a77093e20d91ca867db022461130fc
Contents?: true
Size: 598 Bytes
Versions: 122
Compression:
Stored size: 598 Bytes
Contents
import api, { orgId } from '../../services/api'; import { PRODUCTS_REQUEST, PRODUCTS_SUCCESS, PRODUCTS_FAILURE, } from './ProductConstants'; import { apiError } from '../../utils/helpers.js'; export const loadProducts = (params = {}) => async (dispatch) => { dispatch({ type: PRODUCTS_REQUEST }); try { const { data } = await api.get(`/organizations/${orgId()}/products/`, {}, params); return dispatch({ type: PRODUCTS_SUCCESS, response: data, }); } catch (error) { return dispatch(apiError(PRODUCTS_FAILURE, error)); } }; export default loadProducts;
Version data entries
122 entries across 122 versions & 1 rubygems