Sha256: 7e06490aaf3f1d22e8eef02fcaea016e039deea225833537485e9aff280f5690
Contents?: true
Size: 1.1 KB
Versions: 56
Compression:
Stored size: 1.1 KB
Contents
import { translate as __ } from 'foremanReact/common/I18n'; import { API_OPERATIONS, get, put } from 'foremanReact/redux/API'; import { errorToast } from '../../../../../scenes/Tasks/helpers'; import api, { foremanApi } from '../../../../../services/api'; import { ALTER_HOST_HOST_COLLECTIONS_KEY, AVAILABLE_HOST_COLLECTIONS_KEY, REMOVABLE_HOST_COLLECTIONS_KEY } from './HostCollectionsConstants'; export const getHostAvailableHostCollections = params => get({ type: API_OPERATIONS.GET, key: AVAILABLE_HOST_COLLECTIONS_KEY, url: api.getApiUrl('/host_collections?available_for=host'), params, }); export const getHostRemovableHostCollections = params => get({ type: API_OPERATIONS.GET, key: REMOVABLE_HOST_COLLECTIONS_KEY, url: api.getApiUrl('/host_collections'), params, }); export const alterHostCollections = (hostId, params, refreshHostDetails) => put({ type: API_OPERATIONS.PUT, key: ALTER_HOST_HOST_COLLECTIONS_KEY, url: foremanApi.getApiUrl(`/hosts/${hostId}/host_collections`), params, successToast: () => __('Host collections updated'), errorToast, handleSuccess: refreshHostDetails, });
Version data entries
56 entries across 56 versions & 1 rubygems