mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-17 04:59:37 -04:00
Tell the API which contact list a job’s come from
So that we can make enhancements to the UI in the future, for example grouping jobs within their associated contact list.
This commit is contained in:
@@ -78,12 +78,15 @@ class JobApiClient(NotifyAdminAPIClient):
|
||||
def has_jobs(self, service_id):
|
||||
return bool(self.get_jobs(service_id)['data'])
|
||||
|
||||
def create_job(self, job_id, service_id, scheduled_for=None):
|
||||
def create_job(self, job_id, service_id, scheduled_for=None, contact_list_id=None):
|
||||
data = {"id": job_id}
|
||||
|
||||
if scheduled_for:
|
||||
data.update({'scheduled_for': scheduled_for})
|
||||
|
||||
if contact_list_id:
|
||||
data.update({'contact_list_id': contact_list_id})
|
||||
|
||||
data = _attach_current_user(data)
|
||||
job = self.post(url='/service/{}/job'.format(service_id), data=data)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user