Use new API endpoint to get single contact list

When we first built the contact list feature this endpoint didn’t exist.
Now it does we can remove the slightly cludgy looping-through-all-the-lists
code.
This commit is contained in:
Chris Hill-Scott
2020-03-17 11:30:27 +00:00
parent cb555a4cbe
commit 82634f79de
5 changed files with 42 additions and 10 deletions

View File

@@ -25,7 +25,10 @@ class ContactListApiClient(NotifyAdminAPIClient):
return job
def get_contact_lists(self, service_id):
return self.get('/service/{}/contact-list'.format(service_id))
return self.get(f'/service/{service_id}/contact-list')
def get_contact_list(self, *, service_id, contact_list_id):
return self.get(f'/service/{service_id}/contact-list/{contact_list_id}')
contact_list_api_client = ContactListApiClient()