Use arguments rather than passing around a dict

This makes it harder to write code which will pass tests but fail in
real life.
This commit is contained in:
Chris Hill-Scott
2021-03-11 10:52:03 +00:00
parent fce4082fff
commit 25a6788d66
4 changed files with 37 additions and 13 deletions

View File

@@ -3,8 +3,19 @@ from app.notify_client import NotifyAdminAPIClient
class PerformanceDashboardAPIClient(NotifyAdminAPIClient):
def get_performance_dashboard_stats(self, params_dict=None):
return self.get("/performance-dashboard", params=params_dict)
def get_performance_dashboard_stats(
self,
*,
start_date,
end_date,
):
return self.get(
'/performance-dashboard',
params={
'start_date': str(start_date),
'end_date': str(end_date),
}
)
performance_dashboard_api_client = PerformanceDashboardAPIClient()