File tree Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Expand file tree Collapse file tree 1 file changed +15
-1
lines changed Original file line number Diff line number Diff line change @@ -278,6 +278,18 @@ func (client *Client) DeleteUserFromAccount(accountId, userId string) error {
278278 return nil
279279}
280280
281+ func ToSlimAccount (account Account ) Account {
282+ return Account {ID : account .ID }
283+ }
284+
285+ func ToSlimAccounts (accounts []Account ) []Account {
286+ var result []Account
287+ for i := 0 ; i < len (accounts ); i ++ {
288+ result = append (result , ToSlimAccount (accounts [i ]))
289+ }
290+ return result
291+ }
292+
281293func (client * Client ) UpdateUserAccounts (userId string , accounts []Account ) error {
282294
283295 // API call '/accounts/{accountId}/{userId}/adduser' doesn't work
@@ -287,9 +299,11 @@ func (client *Client) UpdateUserAccounts(userId string, accounts []Account) erro
287299 return err
288300 }
289301
302+ var _accounts = ToSlimAccounts (accounts )
303+
290304 postUser := UserAccounts {
291305 UserName : user .UserName ,
292- Account : accounts ,
306+ Account : _accounts ,
293307 }
294308
295309 body , err := EncodeToJSON (postUser )
You can’t perform that action at this time.
0 commit comments