summaryrefslogtreecommitdiffstats
path: root/src/app/configurableViews/ConfigurableViewReducer.js
blob: 9a5eee0afe12997ee71eeb9cc2d1bdf884f60df2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
import {
  configurableViewsActionTypes
} from './ConfigurableViewConstants.js';

export default (state = {}, action) => {
  let data = action.data;
  switch (action.type) {
    case configurableViewsActionTypes.CONFIGURABLE_VIEWS_CONFIG_RECEIVED:
      return {
        ...state,
        configurableViewsConfig: data
      };
    case configurableViewsActionTypes.CUSTOM_COMPONENTS_RECEIVED:
      return {
        ...state,
        customComponents: data
      };
    case configurableViewsActionTypes.CUSTOM_ROUTES:
      return {
        ...state,
        customRoutes: data
      };
  }

  return state;
};