mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-20 07:21:13 -05:00
Allow jobs to be filtered by contact list
Rather than showing all jobs that have been ‘copied’ from a contact list I think it makes more sense to group them under the contact list. This way it’s easier to see what messages have been sent to a given group of contacts over time. Part of this work means the API needs to return only jobs that have been created from a given contact list, when asked.
This commit is contained in:
@@ -133,6 +133,7 @@ def get_jobs_by_service(service_id):
|
||||
limit_days=limit_days,
|
||||
statuses=[x.strip() for x in request.args.get('statuses', '').split(',')],
|
||||
page=int(request.args.get('page', 1)),
|
||||
contact_list_id=request.args.get('contact_list_id'),
|
||||
))
|
||||
|
||||
|
||||
@@ -193,13 +194,15 @@ def get_paginated_jobs(
|
||||
limit_days,
|
||||
statuses,
|
||||
page,
|
||||
contact_list_id,
|
||||
):
|
||||
pagination = dao_get_jobs_by_service_id(
|
||||
service_id,
|
||||
limit_days=limit_days,
|
||||
page=page,
|
||||
page_size=current_app.config['PAGE_SIZE'],
|
||||
statuses=statuses
|
||||
statuses=statuses,
|
||||
contact_list_id=contact_list_id,
|
||||
)
|
||||
data = job_schema.dump(pagination.items, many=True).data
|
||||
for job_data in data:
|
||||
|
||||
Reference in New Issue
Block a user