save/load dashboard update
This commit is contained in:
@@ -13,7 +13,7 @@ function (angular) {
|
||||
controller : 'DashFromDBProvider',
|
||||
reloadOnSearch: false,
|
||||
})
|
||||
.when('/dashboard/db/:id', {
|
||||
.when('/dashboard/:id', {
|
||||
templateUrl: '/app/partials/dashboard.html',
|
||||
controller : 'DashFromDBProvider',
|
||||
reloadOnSearch: false,
|
||||
@@ -38,6 +38,7 @@ function (angular) {
|
||||
$scope.emitAppEvent('setup-dashboard', dashboard);
|
||||
}).then(null, function(error) {
|
||||
alertSrv.set('Error', error, 'error');
|
||||
$scope.emitAppEvent('setup-dashboard', {});
|
||||
});
|
||||
|
||||
});
|
||||
|
||||
@@ -48,8 +48,8 @@ function (angular) {
|
||||
}
|
||||
|
||||
return $http.post('/api/dashboard/', { dashboard: dashboard })
|
||||
.then(function() {
|
||||
return { title: dashboard.title, url: '/dashboard/db/' + dashboard.title };
|
||||
.then(function(result) {
|
||||
return { title: dashboard.title, url: '/dashboard/' + result.data.slug };
|
||||
}, function(data) {
|
||||
throw "Failed to search: " + data;
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user