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

Version Path
katello-3.11.0.rc2 webpack/scenes/Products/ProductActions.js
katello-3.11.0.rc1 webpack/scenes/Products/ProductActions.js
katello-3.10.0 webpack/scenes/Products/ProductActions.js
katello-3.10.0.rc1.1 webpack/scenes/Products/ProductActions.js
katello-3.9.1 webpack/scenes/Products/ProductActions.js
katello-3.10.0.rc1 webpack/scenes/Products/ProductActions.js
katello-3.9.0 webpack/scenes/Products/ProductActions.js
katello-3.8.1 webpack/scenes/Products/ProductActions.js
katello-3.9.0.rc2 webpack/scenes/Products/ProductActions.js
katello-3.9.0.rc1 webpack/scenes/Products/ProductActions.js
katello-3.7.1.1 webpack/scenes/Products/ProductActions.js
katello-3.7.1 webpack/scenes/Products/ProductActions.js
katello-3.8.0 webpack/scenes/Products/ProductActions.js
katello-3.8.0.rc3 webpack/scenes/Products/ProductActions.js