Sha256: 6d0b9551f8a8a7c2ee48ed250238950e7d6c2ab3b3e7ca31b0eb1381eeb67ef0

Contents?: true

Size: 1.21 KB

Versions: 30

Compression:

Stored size: 1.21 KB

Contents

import { translate as __ } from 'foremanReact/common/I18n';
import { API_OPERATIONS, put } from 'foremanReact/redux/API';
import api, { foremanApi } from '../../../../../services/api';
import HOST_DETAILS_KEY from '../../HostDetailsConstants';
import { ORGANIZATION, AVAILABLE_RELEASE_VERSIONS } from './SystemPurposeConstants';
import { errorToast } from '../../../../../scenes/Tasks/helpers';

export const getOrganization = ({ orgId }) => ({
  type: 'API_GET',
  payload: {
    key: `${ORGANIZATION}_${orgId}`,
    url: api.getApiUrl(`/organizations/${orgId}`),
  },
});

export const getAvailableReleaseVersions = ({ hostId }) => ({
  type: 'API_GET',
  payload: {
    key: `${AVAILABLE_RELEASE_VERSIONS}_${hostId}`,
    url: foremanApi.getApiUrl(`/hosts/${hostId}/subscriptions/available_release_versions`),
  },
});

export const updateSystemPurposeAttributes = ({ hostId, attributes, refreshHostDetails }) => put({
  type: API_OPERATIONS.PUT,
  key: HOST_DETAILS_KEY,
  url: foremanApi.getApiUrl(`/hosts/${hostId}`),
  params: {
    id: hostId,
    host: {
      subscription_facet_attributes: attributes,
    },
  },
  successToast: () => __('System purpose attributes updated'),
  errorToast,
  handleSuccess: refreshHostDetails,
});

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
katello-4.10.0 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.9.2 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.10.0.rc2 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.10.0.rc1 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.8.4 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.9.1 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.8.3 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.9.0 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.7.6 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.8.2 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.9.0.rc2 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.9.0.rc1 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.8.1 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.7.5 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.8.0 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.8.0.rc2 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.7.4 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.8.0.rc1 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.7.3 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js
katello-4.7.2 webpack/components/extensions/HostDetails/Cards/SystemPurposeCard/SystemPurposeActions.js