Sha256: 40c50c585b61dd91553ef1e7de8363c9f1c767a0645a5cf98290e43022a363fc

Contents?: true

Size: 693 Bytes

Versions: 6

Compression:

Stored size: 693 Bytes

Contents

import API from 'foremanReact/API';
import { insightsCloudUrl } from '../InsightsCloudSync/InsightsCloudSyncHelpers';
import {
  INSIGHTS_HITS_REQUEST,
  INSIGHTS_HITS_SUCCESS,
  INSIGHTS_HITS_FAILURE,
} 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 (error) {
    dispatch({
      type: INSIGHTS_HITS_FAILURE,
      payload: {
        error: error.message,
      },
    });
  }
};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
foreman_rh_cloud-0.9.12 webpack/InsightsHostDetailsTab/InsightsTabActions.js
foreman_rh_cloud-1.0.12 webpack/InsightsHostDetailsTab/InsightsTabActions.js
foreman_rh_cloud-2.0.12 webpack/InsightsHostDetailsTab/InsightsTabActions.js
foreman_rh_cloud-0.9.11 webpack/InsightsHostDetailsTab/InsightsTabActions.js
foreman_rh_cloud-1.0.11 webpack/InsightsHostDetailsTab/InsightsTabActions.js
foreman_rh_cloud-2.0.11 webpack/InsightsHostDetailsTab/InsightsTabActions.js