mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 08:31:00 -04:00
Limit templates usage on dashboard to last 7 days
Previous the table of templates on the dashboard was for all time. This commit uses the `limit_days` parameter of the API endpoint to only show template usage from the last 7 days, aligning with the big numbers shown above.
This commit is contained in:
@@ -12,7 +12,11 @@ class TemplateStatisticsApiClient(BaseAPIClient):
|
||||
self.client_id = app.config['ADMIN_CLIENT_USER_NAME']
|
||||
self.secret = app.config['ADMIN_CLIENT_SECRET']
|
||||
|
||||
def get_template_statistics_for_service(self, service_id):
|
||||
def get_template_statistics_for_service(self, service_id, limit_days=None):
|
||||
params = {}
|
||||
if limit_days is not None:
|
||||
params['limit_days'] = limit_days
|
||||
return self.get(
|
||||
url='/service/{}/template-statistics'.format(service_id),
|
||||
params=params
|
||||
)['data']
|
||||
|
||||
Reference in New Issue
Block a user