import React from 'react'; import { post } from 'foremanReact/redux/API'; import { translate as __ } from 'foremanReact/common/I18n'; import { insightsCloudUrl } from './InsightsCloudSyncHelpers'; import { INSIGHTS_CLOUD_SYNC } from './InsightsCloudSyncConstants'; import { foremanUrl } from '../ForemanRhCloudHelpers'; export const syncInsights = () => post({ key: INSIGHTS_CLOUD_SYNC, url: insightsCloudUrl('tasks'), successToast: response => ( {__('Recommendation sync has started: ')} {__('view the task in progress')} ), errorToast: error => `${__('Recommendation sync has failed: ')} ${error}`, });