From 05c3f5fbea430b2773cde0ac62e28ffdc6b26a0b Mon Sep 17 00:00:00 2001 From: Michael Abashian Date: Fri, 13 Jan 2017 16:10:21 -0500 Subject: [PATCH] Fixed bug that was preventing wfjt survey deletion --- .../src/templates/survey-maker/surveys/delete.factory.js | 4 +++- .../client/src/templates/survey-maker/surveys/init.factory.js | 3 ++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/awx/ui/client/src/templates/survey-maker/surveys/delete.factory.js b/awx/ui/client/src/templates/survey-maker/surveys/delete.factory.js index 0dbe5b4c94..48565727f4 100644 --- a/awx/ui/client/src/templates/survey-maker/surveys/delete.factory.js +++ b/awx/ui/client/src/templates/survey-maker/surveys/delete.factory.js @@ -13,6 +13,7 @@ export default var scope = params.scope, id = params.id, + templateType = params.templateType, url; @@ -35,7 +36,8 @@ export default scope.$emit("SurveyDeleted"); } else { - url = GetBasePath('job_templates')+ id + '/survey_spec/'; + let basePath = templateType === 'workflow_job_template' ? GetBasePath('workflow_job_templates') : GetBasePath('job_templates'); + url = basePath + id + '/survey_spec/'; Rest.setUrl(url); Rest.destroy() diff --git a/awx/ui/client/src/templates/survey-maker/surveys/init.factory.js b/awx/ui/client/src/templates/survey-maker/surveys/init.factory.js index d72148875d..e1508e4c4a 100644 --- a/awx/ui/client/src/templates/survey-maker/surveys/init.factory.js +++ b/awx/ui/client/src/templates/survey-maker/surveys/init.factory.js @@ -52,7 +52,8 @@ export default // and closing the modal after success DeleteSurvey({ scope: scope, - id: id + id: id, + templateType: templateType }); };