Use monitor save function from Factory, not controller
This commit is contained in:
parent
1fadbff72d
commit
0436b099d0
|
@ -98,16 +98,9 @@ ZoneMinder.controller('MonitorController', function($scope, $http, $location, Mo
|
||||||
|
|
||||||
// Call Monitor.saveMonitor when the save button is clicked. Pass along $scope.monitor
|
// Call Monitor.saveMonitor when the save button is clicked. Pass along $scope.monitor
|
||||||
$scope.submitMonitor = function() {
|
$scope.submitMonitor = function() {
|
||||||
$http({
|
Monitor.saveMonitor($scope.monitor)
|
||||||
method : 'POST',
|
// Redirect to the dashboard on success
|
||||||
url : '/api/monitors.json',
|
.success(function(data) { window.location = "/index.php?view=console"; });
|
||||||
data : $.param($scope.monitor),
|
|
||||||
headers : { 'Content-Type': 'application/x-www-form-urlencoded' } // set the headers so angular passing info as form data (not request payload)
|
|
||||||
})
|
|
||||||
.success(function(data) {
|
|
||||||
console.log(data);
|
|
||||||
window.location = "/index.php?view=console";
|
|
||||||
});
|
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue