File tree 1 file changed +15
-1
lines changed
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 {
278
278
return nil
279
279
}
280
280
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
+
281
293
func (client * Client ) UpdateUserAccounts (userId string , accounts []Account ) error {
282
294
283
295
// API call '/accounts/{accountId}/{userId}/adduser' doesn't work
@@ -287,9 +299,11 @@ func (client *Client) UpdateUserAccounts(userId string, accounts []Account) erro
287
299
return err
288
300
}
289
301
302
+ var _accounts = ToSlimAccounts (accounts )
303
+
290
304
postUser := UserAccounts {
291
305
UserName : user .UserName ,
292
- Account : accounts ,
306
+ Account : _accounts ,
293
307
}
294
308
295
309
body , err := EncodeToJSON (postUser )
You can’t perform that action at this time.
0 commit comments