Sha256: 2b4e082ce946bbaf8bb2a9d8045cf4f59a8ca948dbee14140b05102fd7f0a782

Contents?: true

Size: 862 Bytes

Versions: 123

Compression:

Stored size: 862 Bytes

Contents

import Immutable from 'seamless-immutable';
import {
  GET_ORGANIZATIONS_LIST_SUCCESS,
  GET_ORGANIZATIONS_LIST_REQUEST,
  GET_ORGANIZATIONS_LIST_FAILURE,
  CHANGE_CURRENT_ORGANIZATION_SUCCESS,
} from '../../redux/consts';

const initialState = Immutable({ loading: false });
export default (state = initialState, action) => {
  const { payload } = action;

  switch (action.type) {
    case GET_ORGANIZATIONS_LIST_REQUEST:
      return state.set('loading', true);

    case GET_ORGANIZATIONS_LIST_SUCCESS:
      return state
        .set('list', payload.results)
        .set('loading', false);

    case CHANGE_CURRENT_ORGANIZATION_SUCCESS:
      return state
        .set('currentId', payload)
        .set('loading', false);

    case GET_ORGANIZATIONS_LIST_FAILURE:
      return state
        .set('error', payload);
    default:
      return state;
  }
};

Version data entries

123 entries across 123 versions & 1 rubygems

Version Path
katello-3.17.0.rc1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc5.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc5 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc4.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.3.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.3 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc4 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc3.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.2 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc3 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc2.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc2 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.1.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc1.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.16.0.rc1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.0.1 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.0 webpack/components/SelectOrg/SelectOrgReducer.js
katello-3.15.0.rc2 webpack/components/SelectOrg/SelectOrgReducer.js