Sha256: da1a142cb41c4fe60b340f650464d608b1fcf1229d39de62e81de24ab2aa248e
Contents?: true
Size: 802 Bytes
Versions: 19
Compression:
Stored size: 802 Bytes
Contents
import API from 'foremanReact/API'; import { addToast } from 'foremanReact/redux/actions/toasts'; import { inventoryUrl } from '../../ForemanInventoryHelpers'; import { EXCLUDE_PACKAGES_TOGGLE } from './ExcludePackagesSwitcherConstants'; export const handleToggle = currentExcludePackages => async dispatch => { const toggledExcludePackages = !currentExcludePackages; try { const { data: { excludePackages }, } = await API.post(inventoryUrl('installed_packages_inclusion'), { value: toggledExcludePackages, }); dispatch({ type: EXCLUDE_PACKAGES_TOGGLE, payload: { excludePackages, }, }); } catch (error) { dispatch( addToast({ sticky: true, type: 'error', message: error.message, }) ); } };
Version data entries
19 entries across 19 versions & 1 rubygems