Get event URL based on whether there is a filter
This commit is contained in:
parent
3847eba14d
commit
d2ac0cac04
|
@ -2,7 +2,8 @@ var ZoneMinder = angular.module('ZoneMinder', [
|
||||||
'ZoneMinderControllers',
|
'ZoneMinderControllers',
|
||||||
'tc.chartjs',
|
'tc.chartjs',
|
||||||
'ui.bootstrap',
|
'ui.bootstrap',
|
||||||
'angularUtils.directives.dirPagination'
|
'angularUtils.directives.dirPagination',
|
||||||
|
'ui.bootstrap.datetimepicker'
|
||||||
]);
|
]);
|
||||||
|
|
||||||
ZoneMinder.config(['$locationProvider', function($locationProvider){
|
ZoneMinder.config(['$locationProvider', function($locationProvider){
|
||||||
|
@ -79,9 +80,13 @@ ZoneMinder.factory('Footer', function($http) {
|
||||||
|
|
||||||
ZoneMinder.factory('Events', function($http) {
|
ZoneMinder.factory('Events', function($http) {
|
||||||
return {
|
return {
|
||||||
get: function(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);
|
return $http.get('/api/events.json?page='+page);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
};
|
};
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue