Fixed API Call. Close #142

This commit is contained in:
Tokuhiro Matsuno 2016-06-25 18:39:55 +09:00
parent b4cab16fda
commit d36760c28c
4 changed files with 8 additions and 8 deletions

View File

@ -42,7 +42,7 @@ define(function () {
templateUrl: '/tpl/projects/environment/add.html',
scope: scope
}).result.then(function (env) {
$http.post(Project.getURL() + '/environment', env)
$http.post(Project.getURL() + '/environment', env.environment)
.success(function () {
$scope.reload();
}).error(function (_, status) {

View File

@ -41,7 +41,7 @@ define(function () {
templateUrl: '/tpl/projects/inventory/add.html',
scope: scope
}).result.then(function (inventory) {
$http.post(Project.getURL() + '/inventory', inventory)
$http.post(Project.getURL() + '/inventory', inventory.inventory)
.success(function () {
$scope.reload();
}).error(function (_, status) {

View File

@ -36,7 +36,7 @@ define(function () {
$modal.open({
templateUrl: '/tpl/projects/keys/add.html'
}).result.then(function (key) {
$http.post(Project.getURL() + '/keys', key).success(function () {
$http.post(Project.getURL() + '/keys', key.key).success(function () {
$scope.reload();
}).error(function (_, status) {
swal('error', 'could not add key:' + status, 'error');

View File

@ -74,7 +74,7 @@ define(function () {
templateUrl: '/tpl/projects/repositories/add.html',
scope: scope
}).result.then(function (repo) {
$http.post(Project.getURL() + '/repositories', repo)
$http.post(Project.getURL() + '/repositories', repo.repo)
.success(function () {
$scope.reload();
}).error(function (_, status) {