mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
Handle the API migration
If it;s the new format API hide the results - Temp fix until new Admin code ships. Should be live for 5 mins.
This commit is contained in:
@@ -16,11 +16,17 @@ class TemplateStatisticsApiClient(BaseAPIClient):
|
||||
params = {}
|
||||
if limit_days is not None:
|
||||
params['limit_days'] = limit_days
|
||||
return self.get(
|
||||
|
||||
response = self.get(
|
||||
url='/service/{}/template-statistics'.format(service_id),
|
||||
params=params
|
||||
)['data']
|
||||
|
||||
if len(response) > 0 and 'template' in response[0]:
|
||||
return response
|
||||
|
||||
return []
|
||||
|
||||
def get_template_statistics_for_template(self, service_id, template_id):
|
||||
return self.get(
|
||||
url='/service/{}/template-statistics/{}'.format(service_id, template_id)
|
||||
|
||||
Reference in New Issue
Block a user