webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js in katello-3.8.0.rc1 vs webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js in katello-3.8.0.rc2
- old
+ new
@@ -2,27 +2,22 @@
import {
SUBSCRIPTION_DETAILS_REQUEST,
SUBSCRIPTION_DETAILS_SUCCESS,
SUBSCRIPTION_DETAILS_FAILURE,
} from './SubscriptionDetailConstants';
-import { getResponseError } from '../../../move_to_foreman/common/helpers.js';
+import { apiError } from '../../../move_to_foreman/common/helpers.js';
-export const loadSubscriptionDetails = subscriptionId => (dispatch) => {
+export const loadSubscriptionDetails = subscriptionId => (dispatch, getState) => {
dispatch({ type: SUBSCRIPTION_DETAILS_REQUEST });
return api
.get(`/organizations/${orgId()}/subscriptions/${subscriptionId}`)
.then(({ data }) => {
dispatch({
type: SUBSCRIPTION_DETAILS_SUCCESS,
response: data,
});
})
- .catch((result) => {
- dispatch({
- type: SUBSCRIPTION_DETAILS_FAILURE,
- error: getResponseError(result.response),
- });
- });
+ .catch(result => dispatch(apiError(SUBSCRIPTION_DETAILS_FAILURE, result)));
};
export default loadSubscriptionDetails;