Sha256: 3c4945597cb2d9ad2845606ed32d512970f1f93b07c5416ff5608f3c563c56d1
Contents?: true
Size: 615 Bytes
Versions: 31
Compression:
Stored size: 615 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 = {}) => 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
31 entries across 31 versions & 1 rubygems