mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-08-20 22:40:31 -04:00
Change format of data sent to api when adding user to service
The endpoint for adding a user to a service in api will now deal with both user permissions and a user's folder permissions, so this changes the format of the data we pass through.
This commit is contained in:
@@ -153,7 +153,10 @@ class UserApiClient(NotifyAdminAPIClient):
|
||||
def add_user_to_service(self, service_id, user_id, permissions):
|
||||
# permissions passed in are the combined admin roles, not db permissions
|
||||
endpoint = '/service/{}/users/{}'.format(service_id, user_id)
|
||||
data = [{'permission': x} for x in translate_permissions_from_admin_roles_to_db(permissions)]
|
||||
data = {
|
||||
'permissions': [{'permission': x} for x in translate_permissions_from_admin_roles_to_db(permissions)]
|
||||
}
|
||||
|
||||
self.post(endpoint, data=data)
|
||||
|
||||
@cache.delete('user-{user_id}')
|
||||
|
||||
Reference in New Issue
Block a user