s/restaurants/suggestions/
This commit is contained in:
36
js/models.js
36
js/models.js
@ -101,31 +101,37 @@ Attendee.prototype.isAttendee = function() {
|
||||
this.Name != empty_attendee.Name;
|
||||
}
|
||||
|
||||
function Restaurant() {
|
||||
this.RestaurantId = -1;
|
||||
this.Name = "";
|
||||
function Suggestion() {
|
||||
this.SuggestionId = -1;
|
||||
this.VetoingId = -1;
|
||||
this.AttendeeId = -1;
|
||||
this.RestaurantName = "";
|
||||
}
|
||||
|
||||
Restaurant.prototype.toJSON = function() {
|
||||
Suggestion.prototype.toJSON = function() {
|
||||
var json_obj = {};
|
||||
json_obj.RestaurantId = this.RestaurantId;
|
||||
json_obj.Name = this.Name;
|
||||
json_obj.SuggestionId = this.SuggestionId;
|
||||
json_obj.AttendeeId = this.AttendeeId;
|
||||
json_obj.RestaurantName = this.RestaurantName;
|
||||
return JSON.stringify(json_obj);
|
||||
}
|
||||
|
||||
Restaurant.prototype.fromJSON = function(json_input) {
|
||||
Suggestion.prototype.fromJSON = function(json_input) {
|
||||
var json_obj = getJSONObj(json_input);
|
||||
|
||||
if (json_obj.hasOwnProperty("RestaurantId"))
|
||||
this.RestaurantId = json_obj.RestaurantId;
|
||||
if (json_obj.hasOwnProperty("Name"))
|
||||
this.Name = json_obj.Name;
|
||||
if (json_obj.hasOwnProperty("SuggestionId"))
|
||||
this.SuggestionId = json_obj.SuggestionId;
|
||||
if (json_obj.hasOwnProperty("AttendeeId"))
|
||||
this.AttendeeId = json_obj.AttendeeId;
|
||||
if (json_obj.hasOwnProperty("RestaurantName"))
|
||||
this.RestaurantName = json_obj.RestaurantName;
|
||||
}
|
||||
|
||||
Restaurant.prototype.isRestaurant = function() {
|
||||
var empty_attendee = new Restaurant();
|
||||
return this.RestaurantId != empty_attendee.RestaurantId ||
|
||||
this.Name != empty_attendee.Name;
|
||||
Suggestion.prototype.isSuggestion = function() {
|
||||
var empty_suggestion = new Suggestion();
|
||||
return this.SuggestionId != empty_suggestion.SuggestionId &&
|
||||
this.AttendeeId != empty_suggestion.AttendeeId &&
|
||||
this.RestaurantName != empty_suggestion.RestaurantName;
|
||||
}
|
||||
|
||||
function Error() {
|
||||
|
Reference in New Issue
Block a user