make cancel normal after copy

This commit is contained in:
John Mitchell 2016-06-15 16:08:45 -04:00
parent b9c2567cf7
commit 7b5bbe52f3
3 changed files with 2 additions and 17 deletions

View File

@ -19,7 +19,7 @@
jobTemplateCopyService.set(res)
.success(function(res){
Wait('stop');
$state.go('jobTemplates.edit', {id: res.id, copied: true}, {reload: true});
$state.go('jobTemplates.edit', {id: res.id}, {reload: true});
});
})
.error(function(res, status){

View File

@ -652,21 +652,7 @@ export default
$scope.formCancel = function () {
// the form was just copied in the previous state, it's safe to destroy on cancel
if ($state.params.copied){
var defaultUrl = GetBasePath('job_templates') + $state.params.id;
Rest.setUrl(defaultUrl);
Rest.destroy()
.success(function(){
$state.go('jobTemplates', null, {reload: true, notify:true});
})
.error(function(res, status){
ProcessErrors($rootScope, res, status, null, {hdr: 'Error!',
msg: 'Call to '+ defaultUrl + ' failed. Return status: '+ status});
});
}
else {
$state.go('jobTemplates');
}
$state.go('jobTemplates');
};
// Related set: Add button

View File

@ -15,7 +15,6 @@ export default {
activityStreamId: 'id'
},
params: {
copied: null
},
ncyBreadcrumb: {
parent: 'jobTemplates',