Sha256: b9e3b50e2744efb77a170c5e7fe871bd76924b349ef6ae541798b6e1be5256ae
Contents?: true
Size: 657 Bytes
Versions: 6
Compression:
Stored size: 657 Bytes
Contents
import API from 'foremanReact/API'; import { AUTO_UPLOAD_TOGGLE, AUTO_UPLOAD_TOGGLE_ERROR, } from './AutoUploadSwitcherConstants'; export const handleToggle = currentAutoUploadEnabled => async dispatch => { const toggledAutoUploadEnabled = !currentAutoUploadEnabled; try { const { data: { autoUploadEnabled }, } = await API.post('auto_upload', { value: toggledAutoUploadEnabled }); dispatch({ type: AUTO_UPLOAD_TOGGLE, payload: { autoUploadEnabled, }, }); } catch (error) { dispatch({ type: AUTO_UPLOAD_TOGGLE_ERROR, payload: { error: error.message, }, }); } };
Version data entries
6 entries across 6 versions & 1 rubygems