Sha256: dd416e3ff99004cd0ed8568aa481cd9b71025dff5afa4a9a962fc176ec9ebcec
Contents?: true
Size: 609 Bytes
Versions: 34
Compression:
Stored size: 609 Bytes
Contents
import api, { orgId } from '../../services/api'; import { PRODUCTS_REQUEST, PRODUCTS_SUCCESS, PRODUCTS_FAILURE, } from './ProductConstants'; import { apiError } from '../../move_to_foreman/common/helpers.js'; export const loadProducts = (params = {}) => (dispatch) => { dispatch({ type: PRODUCTS_REQUEST }); return api .get(`/organizations/${orgId()}/products/`, {}, params) .then(({ data }) => { dispatch({ type: PRODUCTS_SUCCESS, response: data, }); }) .catch(result => dispatch(apiError(PRODUCTS_FAILURE, result))); }; export default loadProducts;
Version data entries
34 entries across 34 versions & 1 rubygems