2018-08-01 18:09:58 +00:00
|
|
|
import {combineReducers} from 'redux';
|
|
|
|
import {RECEIVE_ACCOUNTS, RECEIVE_ACCOUNTS_ERROR} from "../actions";
|
|
|
|
import processesReducer from './processesReducer';
|
2018-08-01 13:13:51 +00:00
|
|
|
|
|
|
|
function accounts(state = {}, action) {
|
|
|
|
switch (action.type) {
|
|
|
|
case RECEIVE_ACCOUNTS:
|
|
|
|
return Object.assign({}, state, {data: action.accounts.data});
|
|
|
|
case RECEIVE_ACCOUNTS_ERROR:
|
|
|
|
return Object.assign({}, state, {error: true});
|
|
|
|
default:
|
|
|
|
return state;
|
|
|
|
}
|
2018-08-01 18:09:58 +00:00
|
|
|
}
|
2018-08-01 13:13:51 +00:00
|
|
|
|
2018-08-01 18:09:58 +00:00
|
|
|
const rootReducer = combineReducers({accounts, processes: processesReducer});
|
2018-08-01 13:13:51 +00:00
|
|
|
export default rootReducer;
|