Sha256: 2fd815cdd72403bb162add892314a2a41b55fb19af23a4c4eb21641142ccb4fd

Contents?: true

Size: 807 Bytes

Versions: 120

Compression:

Stored size: 807 Bytes

Contents

import Immutable from 'seamless-immutable';

import {
  GET_ORGANIZATION_REQUEST,
  GET_ORGANIZATION_SUCCESS,
  GET_ORGANIZATION_FAILURE,
  SAVE_ORGANIZATION_REQUEST,
  SAVE_ORGANIZATION_SUCCESS,
  SAVE_ORGANIZATION_FAILURE,
} from './OrganizationConstants';

const initialState = Immutable({ loading: false });

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

    case GET_ORGANIZATION_SUCCESS:
    case SAVE_ORGANIZATION_SUCCESS: {
      return Immutable({ loading: false, ...action.response });
    }

    case GET_ORGANIZATION_FAILURE:
    case SAVE_ORGANIZATION_FAILURE:
      return Immutable({ error: action.error });

    default:
      return state;
  }
};

Version data entries

120 entries across 120 versions & 1 rubygems

Version Path
katello-4.2.2 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.3.0.rc1 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.2.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.2.0.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.1.4 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.0.3 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.2.0.1.rc3 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.18.5 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.2.0.1.rc2 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.2.0.rc2 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.1.3 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.2.0.rc1 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.0.2.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.1.2.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.0.2 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.1.2 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.18.4 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.1.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.1.0 webpack/scenes/Organizations/OrganizationReducer.js
katello-4.0.1.2 webpack/scenes/Organizations/OrganizationReducer.js