Skip to content

Commit

Permalink
Fix base struct for subaccount create (#331)
Browse files Browse the repository at this point in the history
  • Loading branch information
optik-aper authored Oct 9, 2024
1 parent a130e28 commit d00ea94
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions subaccount.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ type subAccountsBase struct {
Meta *Meta `json:"meta"`
}

type subAccountBase struct {
SubAccount *SubAccount `json:"subaccount"`
}

// SubAccount represents a Vultr sub-account
type SubAccount struct {
ID string `json:"id"`
Expand Down Expand Up @@ -65,11 +69,11 @@ func (s *SubAccountServiceHandler) Create(ctx context.Context, saReq *SubAccount
return nil, nil, err
}

sa := new(SubAccount)
sa := new(subAccountBase)
resp, err := s.client.DoWithContext(ctx, req, sa)
if err != nil {
return nil, resp, err
}

return sa, resp, nil
return sa.SubAccount, resp, nil
}

0 comments on commit d00ea94

Please sign in to comment.