Add attendees and suggestions (except for UI)
This commit is contained in:
20
js/reducers/PopularAttendeeReducer.js
Normal file
20
js/reducers/PopularAttendeeReducer.js
Normal file
@ -0,0 +1,20 @@
|
||||
var assign = require('object-assign');
|
||||
|
||||
var AttendeeConstants = require('../constants/AttendeeConstants');
|
||||
var UserConstants = require('../constants/UserConstants');
|
||||
|
||||
module.exports = function(state = {}, action) {
|
||||
switch (action.type) {
|
||||
case AttendeeConstants.POPULAR_ATTENDEES_FETCHED:
|
||||
var attendees = {};
|
||||
for (var i = 0; i < action.attendees.length; i++) {
|
||||
var attendee = action.attendees[i];
|
||||
attendees[attendee.AttendeeId] = attendee;
|
||||
}
|
||||
return attendees;
|
||||
case UserConstants.USER_LOGGEDOUT:
|
||||
return {};
|
||||
default:
|
||||
return state;
|
||||
}
|
||||
};
|
Reference in New Issue
Block a user