Fixing job submission for textarea

if textarea min is set to 0 and the question is optional, then the UI will pass the API and empty string to the job launch endpoint
This commit is contained in:
Jared Tabor 2015-02-17 16:05:12 -05:00
parent c8682b7820
commit dda00e98f5

View File

@ -81,7 +81,7 @@ angular.module('JobSubmissionHelper', [ 'RestServices', 'Utilities', 'Credential
job_launch_data.extra_vars[fld] = scope[fld];
}
// for optional text and text-areas, submit a blank string if min length is 0
if(scope.survey_questions[i].required === false && (scope.survey_questions[i].type === "text" || scope.survey_questions[i].type === "textarea") && scope.survey_questions[i].min === 0 && scope[fld] ===""){
if(scope.survey_questions[i].required === false && (scope.survey_questions[i].type === "text" || scope.survey_questions[i].type === "textarea") && scope.survey_questions[i].min === 0 && (scope[fld] === "" || scope[fld] === undefined)){
job_launch_data.extra_vars[fld] = "";
}
}