use PUT to update Event and Person objects
This commit is contained in:
parent
ee5e1a829e
commit
ad7cf30b02
2 changed files with 4 additions and 4 deletions
4
angular_app/js/controllers.js
vendored
4
angular_app/js/controllers.js
vendored
|
@ -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) {
|
||||
|
|
|
@ -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, ...)
|
||||
|
|
Loading…
Reference in a new issue