Sha256: 20ff2803c7f8da568dfa7dee5d3e30fdadeb04382c7b05a7c526742ce4e72541

Contents?: true

Size: 961 Bytes

Versions: 6

Compression:

Stored size: 961 Bytes

Contents

import Immutable from 'seamless-immutable';

import {
  MANIFEST_HISTORY_REQUEST,
  MANIFEST_HISTORY_SUCCESS,
  MANIFEST_HISTORY_FAILURE,
  UPLOAD_MANIFEST_SUCCESS,
  DELETE_MANIFEST_SUCCESS,
} from './ManifestConstants';

const initialState = Immutable({ loading: true, results: [] });

export default (state = initialState, action) => {
  switch (action.type) {
    case MANIFEST_HISTORY_REQUEST:
      return state.set('loading', true);

    case MANIFEST_HISTORY_SUCCESS: {
      const results = action.response;

      return state.merge({
        results,
        loading: false,
      });
    }

    case MANIFEST_HISTORY_FAILURE:
      return state.merge({
        error: action.payload.message,
        loading: false,
      });

    case UPLOAD_MANIFEST_SUCCESS:
      return state.set('taskDetails', action.response);

    case DELETE_MANIFEST_SUCCESS:
      return state.set('taskDetails', action.response);

    default:
      return state;
  }
};

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
katello-3.8.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.7.1.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.7.1 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.8.0 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.8.0.rc3 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js
katello-3.8.0.rc2 webpack/scenes/Subscriptions/Manifest/ManifestHistoryReducer.js