Sha256: 9b2e40a5b1579e340d1dd099fb0fecd9f07452659ba943c9242827ed4c760ad9
Contents?: true
Size: 742 Bytes
Versions: 50
Compression:
Stored size: 742 Bytes
Contents
import { API } from 'foremanReact/redux/API'; import { addToast } from 'foremanReact/components/ToastsList'; 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
50 entries across 50 versions & 1 rubygems