Job Template Page-new JT w/ no survey

Fixed a defect where the UI would attempt to save a survey spec even if survey_enabled=false
This commit is contained in:
Jared Tabor
2014-10-27 16:48:34 -04:00
parent f5c21be02f
commit 0bfe5dc6ba

View File

@@ -339,6 +339,7 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
.success(function(data) { .success(function(data) {
$scope.$emit('templateSaveSuccess', data); $scope.$emit('templateSaveSuccess', data);
if(data.survey_enabled===true){
//once the job template information is saved we submit the survey info to the correct endpoint //once the job template information is saved we submit the survey info to the correct endpoint
var url = data.url+ 'survey_spec/'; var url = data.url+ 'survey_spec/';
Rest.setUrl(url); Rest.setUrl(url);
@@ -351,6 +352,8 @@ function JobTemplatesAdd($scope, $rootScope, $compile, $location, $log, $routePa
ProcessErrors($scope, data, status, form, { hdr: 'Error!', ProcessErrors($scope, data, status, form, { hdr: 'Error!',
msg: 'Failed to add new survey. Post returned status: ' + status }); msg: 'Failed to add new survey. Post returned status: ' + status });
}); });
}
}) })
.error(function (data, status) { .error(function (data, status) {