Project

General

Profile

« Previous | Next » 

Revision 44426

ticket #2399

View differences:

repoControllers.js
273 273
			});
274 274
		}
275 275
	
276
		$scope.prepareUpdateRepoApi = function() {
277
			$scope.tempAccessParams = angular.copy($scope.currentRepoApi.accessParams); 
278

  
279
			$scope.tempMdIdPath = '';
280
			angular.forEach($scope.currentRepoApi.otherParams, function(param, pos){
281
	            if (param.name == 'metadata_identifier_path') {
282
	            	$scope.tempMdIdPath = param.value;
283
	            }
284
			});
285
		}
286
		
287
		
276 288
		$scope.updateRepoApi = function() {
277 289
			$scope.showSpinner();
278 290
	
279 291
			var map = {};
280
			angular.forEach($scope.currentRepoApi.accessParams, function(param, pos){
292
			angular.forEach($scope.tempAccessParams, function(param, pos){
281 293
	            if (param.name) {
282 294
	            	map[param.name] = param.value
283 295
	            }
284 296
			});
285

  
286
			var mdIdPath = '';
287
			angular.forEach($scope.currentRepoApi.otherParams, function(param, pos){
288
	            if (param.name == 'metadata_identifier_path') {
289
	            	mdIdPath = param.value;
290
	            }
291
			});
292 297
			
293
			
294 298
			$http.defaults.headers.post["Content-Type"] = "application/x-www-form-urlencoded; charset=UTF-8";
295 299
	        $http.post('repoApi.update', $.param({
296 300
	      		'id'           : $scope.currentRepoApi.repoId,
297 301
	      		'iface'        : $scope.currentRepoApi.id,
298
	      		'mdIdPath'     : mdIdPath,
302
	      		'mdIdPath'     : $scope.tempMdIdPath,
299 303
	      		'accessParams' : JSON.stringify(map)
300 304
	      	})).success(function(data) {
301 305
	      		$scope.showNotification('Api correctly saved !');

Also available in: Unified diff