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:
dni ⚡
2024-01-30 07:48:59 +01:00
committed by GitHub
parent 1d2b939e06
commit 4c102a08e8
6 changed files with 90 additions and 66 deletions
+18
View File
@@ -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: {