Sha256: da1a142cb41c4fe60b340f650464d608b1fcf1229d39de62e81de24ab2aa248e

Contents?: true

Size: 802 Bytes

Versions: 19

Compression:

Stored size: 802 Bytes

Contents

import API from 'foremanReact/API';
import { addToast } from 'foremanReact/redux/actions/toasts';
import { inventoryUrl } from '../../ForemanInventoryHelpers';
import { EXCLUDE_PACKAGES_TOGGLE } from './ExcludePackagesSwitcherConstants';

export const handleToggle = currentExcludePackages => async dispatch => {
  const toggledExcludePackages = !currentExcludePackages;
  try {
    const {
      data: { excludePackages },
    } = await API.post(inventoryUrl('installed_packages_inclusion'), {
      value: toggledExcludePackages,
    });
    dispatch({
      type: EXCLUDE_PACKAGES_TOGGLE,
      payload: {
        excludePackages,
      },
    });
  } catch (error) {
    dispatch(
      addToast({
        sticky: true,
        type: 'error',
        message: error.message,
      })
    );
  }
};

Version data entries

19 entries across 19 versions & 1 rubygems

Version Path
foreman_rh_cloud-2.0.18.1 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-1.0.18 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-2.0.18 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-1.0.17 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-2.0.17 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-2.0.16 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-1.0.16 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-1.0.15 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-2.0.15 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-3.0.14 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-2.0.14 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-1.0.14 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-0.9.14 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-0.9.13.1 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-1.0.13.1 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-2.0.13.1 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-0.9.13 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-1.0.13 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js
foreman_rh_cloud-2.0.13 webpack/ForemanInventoryUpload/Components/ExcludePackagesSwitcher/ExcludePackagesSwitcherActions.js