Sha256: 4127ebf2cad208d97f2531a26d59fdfd168dc1d435ffc6db8afdfae57c64e7e5
Contents?: true
Size: 731 Bytes
Versions: 19
Compression:
Stored size: 731 Bytes
Contents
import API from 'foremanReact/API'; import { addToast } from 'foremanReact/redux/actions/toasts'; import { insightsCloudUrl } from '../InsightsCloudSync/InsightsCloudSyncHelpers'; import { INSIGHTS_HITS_REQUEST, INSIGHTS_HITS_SUCCESS, } from './InsightsTabConstants'; export const fetchHits = hostID => async dispatch => { try { dispatch({ type: INSIGHTS_HITS_REQUEST, payload: {}, }); const { data: { hits }, } = await API.get(insightsCloudUrl(`hits/${hostID}`)); dispatch({ type: INSIGHTS_HITS_SUCCESS, payload: { hits }, }); } catch ({ message }) { dispatch( addToast({ sticky: true, type: 'error', message, }) ); } };
Version data entries
19 entries across 19 versions & 1 rubygems