X-Git-Url: https://osm.etsi.org/gitweb/?a=blobdiff_plain;f=skyquake%2Fplugins%2Fuser_management%2Fsrc%2FplatformRoleManagement%2FplatformRoleManagementSource.js;h=0a0d4c357d6a5dea9c021c5b3aefcea7a171df98;hb=1cf9754552bff8deccef6710bc2cd60f508939e9;hp=2e1f3c0e84800951b4cd4220e9ef15ec212dfb50;hpb=2279bd2b93eb7cf73526ee3cc1ae299f4bcfe48e;p=osm%2FUI.git diff --git a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js index 2e1f3c0e8..0a0d4c357 100644 --- a/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js +++ b/skyquake/plugins/user_management/src/platformRoleManagement/platformRoleManagementSource.js @@ -80,6 +80,7 @@ module.exports = function(Alt) { url: `/platform?api_server=${API_SERVER}`, type: 'PUT', data: project, + dataType: 'json', beforeSend: Utils.addAuthorizationStub, success: function(data, textStatus, jqXHR) { resolve(data); @@ -98,67 +99,9 @@ module.exports = function(Alt) { interceptResponse: interceptResponse({ 'error': 'There was an error updating the project.' }), - success: Alt.actions.global.updateProjectSuccess, + success: Alt.actions.global.updatePlatformSuccess, loading: Alt.actions.global.showScreenLoader, error: Alt.actions.global.showNotification - }, - deleteProject: { - remote: function(state, project) { - return new Promise(function(resolve, reject) { - $.ajax({ - url: `/project/${project['name']}?api_server=${API_SERVER}`, - type: 'DELETE', - beforeSend: Utils.addAuthorizationStub, - success: function(data, textStatus, jqXHR) { - resolve(data); - } - }).fail(function(xhr){ - //Authentication and the handling of fail states should be wrapped up into a connection class. - Utils.checkAuthentication(xhr.status); - let msg = xhr.responseText; - if(xhr.errorMessage) { - msg = xhr.errorMessage - } - reject(msg); - }); - }); - }, - interceptResponse: interceptResponse({ - 'error': 'There was an error deleting the user.' - }), - success: Alt.actions.global.deleteProjectSuccess, - loading: Alt.actions.global.showScreenLoader, - error: Alt.actions.global.showNotification - }, - createProject: { - remote: function(state, project) { - - return new Promise(function(resolve, reject) { - $.ajax({ - url: `/project?api_server=${API_SERVER}`, - type: 'POST', - data: project, - beforeSend: Utils.addAuthorizationStub, - success: function(data, textStatus, jqXHR) { - resolve(data); - } - }).fail(function(xhr){ - //Authentication and the handling of fail states should be wrapped up into a connection class. - Utils.checkAuthentication(xhr.status); - let msg = xhr.responseText; - if(xhr.errorMessage) { - msg = xhr.errorMessage - } - reject(msg); - }); - }); - }, - interceptResponse: interceptResponse({ - 'error': 'There was an error updating the account.' - }), - success: Alt.actions.global.createProjectSuccess, - loading: Alt.actions.global.showScreenLoader, - error: Alt.actions.global.showNotification } } }