diff --git a/angular_app/js/controllers.js b/angular_app/js/controllers.js index 8de8945..0a5067b 100644 --- a/angular_app/js/controllers.js +++ b/angular_app/js/controllers.js @@ -184,7 +184,7 @@ eventManControllers.controller('EventDetailsCtrl', ['$scope', '$state', 'Event', if (this_event.persons) { delete this_event.persons; } - if (this_event.id === undefined) { + if (this_event._id === undefined) { $scope.event = Event.save(this_event); } else { $scope.event = Event.update(this_event); @@ -418,7 +418,7 @@ eventManControllers.controller('PersonDetailsCtrl', ['$scope', '$stateParams', ' // store a new Person or update an existing one $scope.save = function() { - if ($scope.person.id === undefined) { + if ($scope.person._id === undefined) { $scope.person = new Person($scope.person); $scope.person.$save(function(person) { if ($scope.addToEvent) { diff --git a/docs/DEVELOPMENT.md b/docs/DEVELOPMENT.md index 6608073..f26e8bc 100644 --- a/docs/DEVELOPMENT.md +++ b/docs/DEVELOPMENT.md @@ -35,12 +35,12 @@ The paths used to communicate with the Tornado web server: - /events GET - return the list of events - /events POST - store a new event - /events/:event_id GET - return information about an existing event -- /events/:event_id POST - update an existing event +- /events/:event_id PUT - update an existing event - /events/:event_id DELETE - delete an existing event - /persons GET - return the list of persons - /persons POST - store a new person - /persons/:person_id GET - return information about an existing person -- /persons/:person_id POST - update an existing person +- /persons/:person_id PUT - update an existing person - /persons/:person_id DELETE - delete an existing person - /events/:event_id/persons GET - return the complete list of persons registered for the event - /events/:event_id/persons/:person_id GET - return information about a person related to a given event (e.g.: name, surname, ticket ID, ...)