From d36760c28c5e994698c0168a7a0f32fd06336290 Mon Sep 17 00:00:00 2001 From: Tokuhiro Matsuno Date: Sat, 25 Jun 2016 18:39:55 +0900 Subject: [PATCH] Fixed API Call. Close #142 --- public/js/controllers/projects/environment.js | 4 ++-- public/js/controllers/projects/inventory.js | 4 ++-- public/js/controllers/projects/keys.js | 4 ++-- public/js/controllers/projects/repositories.js | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/public/js/controllers/projects/environment.js b/public/js/controllers/projects/environment.js index 008036a6..33632346 100644 --- a/public/js/controllers/projects/environment.js +++ b/public/js/controllers/projects/environment.js @@ -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) { @@ -74,4 +74,4 @@ define(function () { $scope.reload(); }]); -}); \ No newline at end of file +}); diff --git a/public/js/controllers/projects/inventory.js b/public/js/controllers/projects/inventory.js index 676635ba..16569c07 100644 --- a/public/js/controllers/projects/inventory.js +++ b/public/js/controllers/projects/inventory.js @@ -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) { @@ -104,4 +104,4 @@ define(function () { $scope.reload(); }]); -}); \ No newline at end of file +}); diff --git a/public/js/controllers/projects/keys.js b/public/js/controllers/projects/keys.js index 5eca0f46..6a52dc50 100644 --- a/public/js/controllers/projects/keys.js +++ b/public/js/controllers/projects/keys.js @@ -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'); @@ -69,4 +69,4 @@ define(function () { $scope.reload(); }]); -}); \ No newline at end of file +}); diff --git a/public/js/controllers/projects/repositories.js b/public/js/controllers/projects/repositories.js index c5168d26..4d7cc3b3 100644 --- a/public/js/controllers/projects/repositories.js +++ b/public/js/controllers/projects/repositories.js @@ -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) { @@ -85,4 +85,4 @@ define(function () { $scope.reload(); }]); -}); \ No newline at end of file +});