Add full ability to add/delete attendees
This commit is contained in:
29
js/containers/RecordLunchContainer.js
Normal file
29
js/containers/RecordLunchContainer.js
Normal file
@ -0,0 +1,29 @@
|
||||
var connect = require('react-redux').connect;
|
||||
|
||||
var UserActions = require('../actions/UserActions');
|
||||
var AttendeeActions = require('../actions/AttendeeActions');
|
||||
var SuggestionActions = require('../actions/SuggestionActions');
|
||||
|
||||
var RecordLunch = require('../components/RecordLunch');
|
||||
|
||||
function mapStateToProps(state) {
|
||||
return {
|
||||
attendees: state.attendees,
|
||||
popularAttendees: state.popularAttendees,
|
||||
suggestions: state.suggestions,
|
||||
popularSuggestions: state.popularSuggestions
|
||||
}
|
||||
}
|
||||
|
||||
function mapDispatchToProps(dispatch) {
|
||||
return {
|
||||
createAttendee: function(attendee) {dispatch(AttendeeActions.create(attendee))},
|
||||
removeAttendee: function(attendee) {dispatch(AttendeeActions.remove(attendee))},
|
||||
createSuggestion: function(suggestion) {dispatch(SuggestionActions.create(suggestion))}
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = connect(
|
||||
mapStateToProps,
|
||||
mapDispatchToProps
|
||||
)(RecordLunch)
|
Reference in New Issue
Block a user