mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-14 23:08:07 -04:00
Make jobs filterable by notification status
We can filter all notifications by status already. This commit reuses the same code to filter the notifications for a job by status. This means that, visually we can show the count on a job the same as we do for all notifications, which is similar to how we show the counts on the dashboard, so hopefully it feels like a bit more of a solid thing. This also applies to CSV downloads and AJAX updates, which will inherit any filtering that their parent page has applied.
This commit is contained in:
@@ -14,9 +14,12 @@ class JobApiClient(BaseAPIClient):
|
||||
self.client_id = app.config['ADMIN_CLIENT_USER_NAME']
|
||||
self.secret = app.config['ADMIN_CLIENT_SECRET']
|
||||
|
||||
def get_job(self, service_id, job_id=None, limit_days=None):
|
||||
def get_job(self, service_id, job_id=None, limit_days=None, status=None):
|
||||
if job_id:
|
||||
return self.get(url='/service/{}/job/{}'.format(service_id, job_id))
|
||||
params = {}
|
||||
if status is not None:
|
||||
params['status'] = status
|
||||
return self.get(url='/service/{}/job/{}'.format(service_id, job_id), params=params)
|
||||
params = {}
|
||||
if limit_days is not None:
|
||||
params['limit_days'] = limit_days
|
||||
|
||||
Reference in New Issue
Block a user