Get event URL based on whether there is a filter

This commit is contained in:
Kyle Johnson 2015-01-21 10:22:25 -05:00
parent 3847eba14d
commit d2ac0cac04
1 changed files with 8 additions and 3 deletions

View File

@ -2,7 +2,8 @@ var ZoneMinder = angular.module('ZoneMinder', [
'ZoneMinderControllers',
'tc.chartjs',
'ui.bootstrap',
'angularUtils.directives.dirPagination'
'angularUtils.directives.dirPagination',
'ui.bootstrap.datetimepicker'
]);
ZoneMinder.config(['$locationProvider', function($locationProvider){
@ -79,8 +80,12 @@ ZoneMinder.factory('Footer', function($http) {
ZoneMinder.factory('Events', function($http) {
return {
get: function(page) {
return $http.get('/api/events.json?page='+page);
get: function(filter, page) {
if (filter) {
return $http.get('/api/events/index/'+filter+'.json?page='+page);
} else {
return $http.get('/api/events.json?page='+page);
}
}
};
});