mirror of
https://github.com/ChuckNorrison/LightningTipBot.git
synced 2026-08-17 13:07:16 +02:00
fix naming
This commit is contained in:
parent
2642965052
commit
0ecbb8d58c
1 changed files with 4 additions and 4 deletions
|
|
@ -44,7 +44,7 @@ func (c *Client) GetUser(userId string) (user User, err error) {
|
|||
}
|
||||
|
||||
// CreateUserWithInitialWallet creates new user with initial wallet
|
||||
func (c *Client) CreateUserWithInitialWallet(userName, walletName, adminId string, email string) (wal User, err error) {
|
||||
func (c *Client) CreateUserWithInitialWallet(userName, walletName, adminId string, email string) (user User, err error) {
|
||||
resp, err := req.Post(c.url+"/usermanager/api/v1/users", c.header, req.BodyJSON(struct {
|
||||
WalletName string `json:"wallet_name"`
|
||||
AdminId string `json:"admin_id"`
|
||||
|
|
@ -61,14 +61,14 @@ func (c *Client) CreateUserWithInitialWallet(userName, walletName, adminId strin
|
|||
err = reqErr
|
||||
return
|
||||
}
|
||||
err = resp.ToJSON(&wal)
|
||||
err = resp.ToJSON(&user)
|
||||
res := gjson.Get(resp.String(), "wallets.0")
|
||||
if res.Index == 0 {
|
||||
err = fmt.Errorf("could not create initial wallet")
|
||||
return
|
||||
}
|
||||
wal.Wallet = &Wallet{}
|
||||
err = json.Unmarshal([]byte(res.Raw), wal.Wallet)
|
||||
user.Wallet = &Wallet{}
|
||||
err = json.Unmarshal([]byte(res.Raw), user.Wallet)
|
||||
return
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue