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-3.11.0 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.11.0.rc2 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.11.0.rc1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.10.0 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.10.0.rc1.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.9.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.10.0.rc1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.9.0 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.8.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.9.0.rc2 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.9.0.rc1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.7.1.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.7.1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.8.0 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.8.0.rc3 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.8.0.rc2 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.7.0 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.8.0.rc1 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.7.0.rc2 webpack/scenes/Organizations/OrganizationReducer.js
katello-3.7.0.rc1 webpack/scenes/Organizations/OrganizationReducer.js