Revision 57100
Added by Michele Artini about 5 years ago
modules/dnet-orgs-database-application/trunk/src/main/resources/static/js/organizations.js | ||
---|---|---|
27 | 27 |
}; |
28 | 28 |
}); |
29 | 29 |
|
30 |
orgsModule.controller('newOrgCtrl', function ($scope, $http, $routeParams) { |
|
30 |
orgsModule.controller('newOrgCtrl', function ($scope, $http, $routeParams, $location) {
|
|
31 | 31 |
$scope.org = { |
32 | 32 |
"id": "", |
33 | 33 |
"name": "", |
... | ... | |
51 | 51 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
52 | 52 |
}); |
53 | 53 |
|
54 |
$scope.save = function() { |
|
55 |
$http.defaults.headers.post["Content-Type"] = "application/json;charset=UTF-8"; |
|
56 |
$http.post('/api/organizations/save?update=false', $scope.org).then(function successCallback(res) { |
|
57 |
alert('Organization saved !!!'); |
|
58 |
$location.url('/metadata/' + res.data[0]); |
|
59 |
}, function errorCallback(res) { |
|
60 |
alert('ERROR: ' + res.data.error + ' (' + res.data.message + ')'); |
|
61 |
}); |
|
62 |
} |
|
63 |
|
|
54 | 64 |
}); |
55 | 65 |
|
56 | 66 |
orgsModule.controller('searchCtrl', function ($scope, $http, $routeParams) {}); |
Also available in: Unified diff