mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 16:38:59 -04:00
move away from statistics_api towards service_api
This commit is contained in:
@@ -15,7 +15,6 @@ from flask_login import login_required
|
||||
from app.main import main
|
||||
from app import (
|
||||
job_api_client,
|
||||
statistics_api_client,
|
||||
service_api_client,
|
||||
template_statistics_client
|
||||
)
|
||||
@@ -90,7 +89,7 @@ def usage(service_id):
|
||||
@login_required
|
||||
@user_has_permissions('manage_settings', admin_override=True)
|
||||
def weekly(service_id):
|
||||
stats = statistics_api_client.get_weekly_notification_stats(service_id)['data']
|
||||
stats = service_api_client.get_weekly_notification_stats(service_id)['data']
|
||||
return render_template(
|
||||
'views/weekly.html',
|
||||
days=format_weekly_stats_to_list(stats),
|
||||
|
||||
@@ -193,6 +193,9 @@ class ServiceAPIClient(NotificationsAPIClient):
|
||||
def get_service_usage(self, service_id):
|
||||
return self.get('/service/{0}/fragment/aggregate_statistics'.format(service_id))
|
||||
|
||||
def get_weekly_notification_stats(self, service_id):
|
||||
return self.get(url='/service/{}/notifications/weekly'.format(service_id))
|
||||
|
||||
|
||||
class ServicesBrowsableItem(BrowsableItem):
|
||||
@property
|
||||
|
||||
@@ -23,9 +23,6 @@ class StatisticsApiClient(BaseAPIClient):
|
||||
else:
|
||||
raise e
|
||||
|
||||
def get_weekly_notification_stats(self, service_id):
|
||||
return self.get(url='/service/{}/notifications/weekly'.format(service_id))
|
||||
|
||||
def get_statistics_for_all_services_for_day(self, day):
|
||||
params = {
|
||||
'day': day
|
||||
|
||||
Reference in New Issue
Block a user