Sha256: ff01719a9ab41c0ea075f3363dfd423fd3717b7763ed66ad8ae97e84e30f3a91
Contents?: true
Size: 822 Bytes
Versions: 19
Compression:
Stored size: 822 Bytes
Contents
import API from 'foremanReact/API'; import { addToast } from 'foremanReact/redux/actions/toasts'; import { inventoryUrl } from '../../ForemanInventoryHelpers'; import { IPS_OBFUSCATION_TOGGLE } from './IpsObfuscationSwitcherConstants'; export const handleToggle = currentIpsObfuscationEnabled => async dispatch => { const toggledIpsObfuscationEnabled = !currentIpsObfuscationEnabled; try { const { data: { ipsObfuscationEnabled }, } = await API.post(inventoryUrl('ips_obfuscation'), { value: toggledIpsObfuscationEnabled, }); dispatch({ type: IPS_OBFUSCATION_TOGGLE, payload: { ipsObfuscationEnabled, }, }); } catch (error) { dispatch( addToast({ sticky: true, type: 'error', message: error.message, }) ); } };
Version data entries
19 entries across 19 versions & 1 rubygems