Sha256: 9a424dd014a3ab1d9d4bac432c434f425fcbbb7d214ba49057b8160b1ba01b50
Contents?: true
Size: 804 Bytes
Versions: 15
Compression:
Stored size: 804 Bytes
Contents
import API from 'foremanReact/API'; import { inventoryUrl } from '../../ForemanInventoryHelpers'; import { HOST_OBFUSCATION_TOGGLE, HOST_OBFUSCATION_TOGGLE_ERROR, } from './HostObfuscationSwitcherConstants'; export const handleToggle = currentHostObfuscationEnabled => async dispatch => { const toggledHostObfuscationEnabled = !currentHostObfuscationEnabled; try { const { data: { hostObfuscationEnabled }, } = await API.post(inventoryUrl('host_obfuscation'), { value: toggledHostObfuscationEnabled, }); dispatch({ type: HOST_OBFUSCATION_TOGGLE, payload: { hostObfuscationEnabled, }, }); } catch (error) { dispatch({ type: HOST_OBFUSCATION_TOGGLE_ERROR, payload: { error: error.message, }, }); } };
Version data entries
15 entries across 15 versions & 1 rubygems