diff --git a/internal/lnbits/lnbits.go b/internal/lnbits/lnbits.go index e67fb3d..fd743c0 100644 --- a/internal/lnbits/lnbits.go +++ b/internal/lnbits/lnbits.go @@ -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 }