mirror of
https://github.com/aclindsa/moneygo.git
synced 2024-11-14 10:50:04 -05:00
19 lines
457 B
JavaScript
19 lines
457 B
JavaScript
|
var assign = require('object-assign');
|
||
|
|
||
|
var ReportConstants = require('../constants/ReportConstants');
|
||
|
var UserConstants = require('../constants/UserConstants');
|
||
|
|
||
|
module.exports = function(state = {}, action) {
|
||
|
switch (action.type) {
|
||
|
case ReportConstants.REPORT_FETCHED:
|
||
|
var report = action.report;
|
||
|
return assign({}, state, {
|
||
|
[report.ReportId]: report
|
||
|
});
|
||
|
case UserConstants.USER_LOGGEDOUT:
|
||
|
return {};
|
||
|
default:
|
||
|
return state;
|
||
|
}
|
||
|
};
|