Sha256: f768cd386403c81d2eddc6c90c4dea9fd8e70f5c5d2214ae15396c05f14da2fa
Contents?: true
Size: 741 Bytes
Versions: 36
Compression:
Stored size: 741 Bytes
Contents
import { API } from 'foremanReact/redux/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
36 entries across 36 versions & 1 rubygems