mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-05-05 00:20:43 -04:00
Add additional params to get notifications client
We want to show a log of notifications that have been sent from the API. The admin app uses its own private `/service/…/notifications` endpoint for listing activity. This commit allows us to pass through two optional, additional parameters to tell the API to: - include or not include notifications created from a job - include or not include notifications created with a test API key
This commit is contained in:
@@ -27,7 +27,9 @@ class NotificationApiClient(BaseAPIClient):
|
||||
status=None,
|
||||
page=None,
|
||||
page_size=None,
|
||||
limit_days=None
|
||||
limit_days=None,
|
||||
include_jobs=None,
|
||||
include_from_test_key=None
|
||||
):
|
||||
params = {}
|
||||
if page is not None:
|
||||
@@ -38,6 +40,10 @@ class NotificationApiClient(BaseAPIClient):
|
||||
params['template_type'] = template_type
|
||||
if status is not None:
|
||||
params['status'] = status
|
||||
if include_jobs is not None:
|
||||
params['include_jobs'] = include_jobs
|
||||
if include_from_test_key is not None:
|
||||
params['include_from_test_key'] = include_from_test_key
|
||||
if job_id:
|
||||
return self.get(
|
||||
url='/service/{}/job/{}/notifications'.format(service_id, job_id),
|
||||
|
||||
Reference in New Issue
Block a user