mirror of
https://github.com/aclindsa/moneygo.git
synced 2025-07-02 04:18:38 -04:00
reports: Allow drilling down
This commit is contained in:
23
js/reducers/SelectedReportReducer.js
Normal file
23
js/reducers/SelectedReportReducer.js
Normal file
@ -0,0 +1,23 @@
|
||||
var assign = require('object-assign');
|
||||
|
||||
var ReportConstants = require('../constants/ReportConstants');
|
||||
var UserConstants = require('../constants/UserConstants');
|
||||
|
||||
const initialState = {
|
||||
report: null,
|
||||
seriesTraversal: []
|
||||
};
|
||||
|
||||
module.exports = function(state = initialState, action) {
|
||||
switch (action.type) {
|
||||
case ReportConstants.REPORT_SELECTED:
|
||||
return {
|
||||
report: action.report,
|
||||
seriesTraversal: action.seriesTraversal
|
||||
};
|
||||
case UserConstants.USER_LOGGEDOUT:
|
||||
return initialState;
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user