make saving a schedule send you back to the list route

This commit is contained in:
John Mitchell
2016-02-12 11:59:39 -05:00
parent 37c97c968d
commit f8550a478b

View File

@@ -55,9 +55,9 @@ export default
}]) }])
.factory('EditSchedule', ['SchedulerInit', 'ShowSchedulerModal', 'Wait', .factory('EditSchedule', ['SchedulerInit', 'ShowSchedulerModal', 'Wait',
'Rest', 'ProcessErrors', 'GetBasePath', 'SchedulePost', 'Rest', 'ProcessErrors', 'GetBasePath', 'SchedulePost', '$state',
function(SchedulerInit, ShowSchedulerModal, Wait, Rest, ProcessErrors, function(SchedulerInit, ShowSchedulerModal, Wait, Rest, ProcessErrors,
GetBasePath, SchedulePost) { GetBasePath, SchedulePost, $state) {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,
id = params.id, id = params.id,
@@ -171,6 +171,7 @@ export default
if (callback) { if (callback) {
scope.$emit(callback, data); scope.$emit(callback, data);
} }
$state.go("^");
}); });
scope.saveSchedule = function() { scope.saveSchedule = function() {
@@ -208,8 +209,8 @@ export default
}]) }])
.factory('AddSchedule', ['$location', '$stateParams', 'SchedulerInit', 'ShowSchedulerModal', 'Wait', 'GetBasePath', 'Empty', .factory('AddSchedule', ['$location', '$stateParams', 'SchedulerInit', 'ShowSchedulerModal', 'Wait', 'GetBasePath', 'Empty',
'SchedulePost', 'SchedulePost', '$state',
function($location, $stateParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost) { function($location, $stateParams, SchedulerInit, ShowSchedulerModal, Wait, GetBasePath, Empty, SchedulePost, $state) {
return function(params) { return function(params) {
var scope = params.scope, var scope = params.scope,
callback= params.callback, callback= params.callback,
@@ -280,6 +281,7 @@ export default
if (callback) { if (callback) {
scope.$emit(callback, data); scope.$emit(callback, data);
} }
$state.go("^");
}); });
scope.saveSchedule = function() { scope.saveSchedule = function() {