From da657ac7df4cea2e57aa51e3639d514d30f4e444 Mon Sep 17 00:00:00 2001 From: seshukm Date: Mon, 3 Apr 2017 17:00:28 +0530 Subject: create Site IssueID : CLIENT-189 Change-Id: I0824e65d196f083afb8b93b341bc3838a80a4290 Signed-off-by: seshukm --- resmgr/src/main/webapp/resmgr/js/app.js | 16 ++++++++++++---- .../src/main/webapp/resmgr/sdn-resmgr/site/siteRest.js | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'resmgr') diff --git a/resmgr/src/main/webapp/resmgr/js/app.js b/resmgr/src/main/webapp/resmgr/js/app.js index af3a17ae..271041f9 100644 --- a/resmgr/src/main/webapp/resmgr/js/app.js +++ b/resmgr/src/main/webapp/resmgr/js/app.js @@ -478,10 +478,17 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) } $scope.saveData = function(id) { if (!$scope.textboxErrName) { + + + var sites ={}; + sites.site=$scope.site; + sites.site.type="tenant_site"; + + console.log("save data.." + JSON.stringify(sites.site)); if(id) { //edit data - console.log("Editing data.." + JSON.stringify($scope.site)); - siteDataService.editSiteData($scope.site) + console.log("Editing data.." + JSON.stringify(sites)); + siteDataService.editSiteData(sites) .then(function (data) { $scope.message = "Success :-)"; $state.reload(); @@ -492,8 +499,9 @@ var app = angular.module("ResourceMgrApp", ["ui.router", "ngTable"]) }); } else { - console.log("Adding data.." + JSON.stringify($scope.site)); - siteDataService.addSiteData($scope.site) + console.log("Adding data.." + JSON.stringify(sites.site)); + + siteDataService.addSiteData(sites) .then(function (data) { $scope.message = "Success :-)"; $state.reload(); diff --git a/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/siteRest.js b/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/siteRest.js index 08c89fc2..329fd3da 100644 --- a/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/siteRest.js +++ b/resmgr/src/main/webapp/resmgr/sdn-resmgr/site/siteRest.js @@ -82,6 +82,7 @@ app.factory("siteDataService", function($http, DataService, $log){ console.log(response.data); return response.data; });*/ + console.log("In siteRest"); return DataService.post(uri+'/openoapi/sdnobrs/v1/sites', siteData) .then(function(response){ console.log("Successfully added.. Data returned in DataService is"); -- cgit 1.2.3-korg