Variables renamed in projectManagementAPI.js
[osm/UI.git] / skyquake / framework / core / modules / api / projectManagementAPI.js
index 07e873d..25fcebe 100644 (file)
@@ -107,13 +107,11 @@ ProjectManagement.update = function(req) {
     var self = this;
     var api_server = req.query['api_server'];
     var bodyData = req.body;
-    data = {
-        "project":[bodyData]
-    }
+    data = bodyData['project-config']
     var updateTasks = [];
 
-    var updateUser = rp({
-                uri: utils.confdPort(api_server) + '/api/config/project',
+    var updateProject= rp({
+                uri: utils.confdPort(api_server) + '/api/config/project/' + bodyData.name + '/project-config',
                 method: 'PUT',
                 headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
                     'Authorization': req.session && req.session.authorization
@@ -123,7 +121,7 @@ ProjectManagement.update = function(req) {
                 rejectUnauthorized: false,
                 resolveWithFullResponse: true
             });
-    updateTasks.push(updateUser)
+    updateTasks.push(updateProject)
     return new Promise(function(resolve, reject) {
         Promise.all([
             updateTasks
@@ -228,9 +226,10 @@ ProjectManagement.updatePlatform = function(req) {
     var api_server = req.query['api_server'];
     var bodyData = req.body;
     data = bodyData;
+    data.user = JSON.parse(data.user)
     var updateTasks = [];
 
-    var updateUser = rp({
+    var updatePlatform = rp({
                 uri: utils.confdPort(api_server) + '/api/config/rbac-platform-config',
                 method: 'PUT',
                 headers: _.extend({}, constants.HTTP_HEADERS.accept.data, {
@@ -241,7 +240,7 @@ ProjectManagement.updatePlatform = function(req) {
                 rejectUnauthorized: false,
                 resolveWithFullResponse: true
             });
-    updateTasks.push(updateUser)
+    updateTasks.push(updatePlatform)
     return new Promise(function(resolve, reject) {
         Promise.all([
             updateTasks