suggestions: Properly set VetoingId
This commit is contained in:
@ -103,7 +103,11 @@ module.exports = React.createClass({
|
||||
var suggestion = new Suggestion();
|
||||
suggestion.AttendeeId = this.state.attendee.AttendeeId;
|
||||
suggestion.RestaurantName = this.state.suggestion;
|
||||
suggestion.VetoingId = this.getLastSuggestion();
|
||||
var lastSuggestionIndex = this.getLastSuggestion();
|
||||
if (lastSuggestionIndex > -1)
|
||||
suggestion.VetoingId = this.props.suggestions[lastSuggestionIndex].SuggestionId;
|
||||
else
|
||||
suggestion.VetoingId = -1;
|
||||
this.props.createSuggestion(suggestion);
|
||||
this.setState({
|
||||
attendee: null,
|
||||
|
Reference in New Issue
Block a user