refactor: topup wallet + into component (#2217)
* refactor: topup wallet `+` into component this will also be used in the usermanager * bundle
This commit is contained in:
@@ -144,6 +144,24 @@ window.LNbits = {
|
||||
'/api/v1/payments/' + paymentHash,
|
||||
wallet.inkey
|
||||
)
|
||||
},
|
||||
updateBalance: function (credit, wallet_id) {
|
||||
return LNbits.api
|
||||
.request('PUT', '/admin/api/v1/topup/', null, {
|
||||
amount: credit,
|
||||
id: wallet_id
|
||||
})
|
||||
.then(_ => {
|
||||
Quasar.Notify.create({
|
||||
type: 'positive',
|
||||
message: 'Success! Added ' + credit + ' sats to ' + wallet_id,
|
||||
icon: null
|
||||
})
|
||||
return parseInt(credit)
|
||||
})
|
||||
.catch(function (error) {
|
||||
LNbits.utils.notifyApiError(error)
|
||||
})
|
||||
}
|
||||
},
|
||||
events: {
|
||||
|
||||
Reference in New Issue
Block a user