mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 14:29:51 -04:00
Add limit_days argument to statistics API client method
Allows getting notification counts for a given number of days to support services with custom data retention periods (admin dashboard page should still display counts for the last 7 days, while the notifications page displays all stored notifications).
This commit is contained in:
@@ -41,8 +41,10 @@ class ServiceAPIClient(NotifyAdminAPIClient):
|
||||
"""
|
||||
return self.get('/service/{0}'.format(service_id))
|
||||
|
||||
def get_service_statistics(self, service_id, today_only):
|
||||
return self.get('/service/{0}/statistics'.format(service_id), params={'today_only': today_only})['data']
|
||||
def get_service_statistics(self, service_id, today_only, limit_days=None):
|
||||
return self.get('/service/{0}/statistics'.format(service_id), params={
|
||||
'today_only': today_only, 'limit_days': limit_days
|
||||
})['data']
|
||||
|
||||
def get_services(self, params_dict=None):
|
||||
"""
|
||||
|
||||
Reference in New Issue
Block a user