Pass service_id through to API '/service/unique' endpoint

Notifications-api now needs the service_id to check the uniqueness of
the service name when trying to change it. This is to allow a user to
successfully change the pluralization or the case of their service name.
This commit is contained in:
Katie Smith
2018-02-13 11:27:57 +00:00
parent 0f20cfe8bc
commit 84d810b981
3 changed files with 4 additions and 4 deletions

View File

@@ -237,12 +237,12 @@ class ServiceAPIClient(NotifyAdminAPIClient):
data = _attach_current_user(data)
return self.post(endpoint, data=data)
def is_service_name_unique(self, name, email_from):
def is_service_name_unique(self, service_id, name, email_from):
"""
Check that the service name or email from are unique across all services.
"""
endpoint = "/service/unique"
params = {"name": name, "email_from": email_from}
params = {"service_id": service_id, "name": name, "email_from": email_from}
return self.get(url=endpoint, params=params)["result"]
# Temp access of service history data. Includes service and api key history