Sha256: b5466ca4aff00683b40b821357bca77fe2de6659b28137f4c52e9e52742ee399

Contents?: true

Size: 856 Bytes

Versions: 31

Compression:

Stored size: 856 Bytes

Contents

import { propsToSnakeCase } from 'foremanReact/common/helpers';

import api, { orgId } from '../../services/api';
import {
  ANSIBLE_COLLECTIONS_REQUEST,
  ANSIBLE_COLLECTIONS_SUCCESS,
  ANSIBLE_COLLECTIONS_ERROR,
} from './AnsibleCollectionsConstants';
import { apiError } from '../../move_to_foreman/common/helpers';

export const getAnsibleCollections = (extendedParams = {}) => async (dispatch) => {
  dispatch({ type: ANSIBLE_COLLECTIONS_REQUEST });

  const params = {
    organization_id: orgId(),
    ...propsToSnakeCase(extendedParams),
  };

  try {
    const { data } = await api.get('/ansible_collections', {}, params);
    return dispatch({
      type: ANSIBLE_COLLECTIONS_SUCCESS,
      response: data,
    });
  } catch (error) {
    return dispatch(apiError(ANSIBLE_COLLECTIONS_ERROR, error));
  }
};

export default getAnsibleCollections;

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
katello-3.16.2 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.1.2 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.1.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc5.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc5 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc4.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.15.3.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.15.3 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc4 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc3.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.15.2 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc3 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc2.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc2 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.15.1.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc1.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.15.1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js
katello-3.16.0.rc1 webpack/scenes/AnsibleCollections/AnsibleCollectionsActions.js