fix: note update
This commit is contained in:
parent
f11a51a4cc
commit
f1976e624d
|
@ -110,6 +110,9 @@ async function addressList(path) {
|
|||
},
|
||||
searchInTab: function (tab, value) {
|
||||
this.$emit('search:tab', {tab, value})
|
||||
},
|
||||
updateNoteForAddress: async function (addressData, note) {
|
||||
this.$emit('update:note', {addressId: addressData.id, note})
|
||||
}
|
||||
},
|
||||
|
||||
|
|
|
@ -98,17 +98,17 @@ const watchOnly = async () => {
|
|||
LNbits.utils.notifyApiError(err)
|
||||
}
|
||||
},
|
||||
updateNoteForAddress: async function (addressData, note) {
|
||||
updateNoteForAddress: async function ({addressId, note}) {
|
||||
try {
|
||||
const wallet = this.g.user.wallets[0]
|
||||
await LNbits.api.request(
|
||||
'PUT',
|
||||
`/watchonly/api/v1/address/${addressData.id}`,
|
||||
`/watchonly/api/v1/address/${addressId}`,
|
||||
wallet.adminkey,
|
||||
{note: addressData.note}
|
||||
{note}
|
||||
)
|
||||
const updatedAddress =
|
||||
this.addresses.find(a => a.id === addressData.id) || {}
|
||||
this.addresses.find(a => a.id === addressId) || {}
|
||||
updatedAddress.note = note
|
||||
} catch (err) {
|
||||
LNbits.utils.notifyApiError(err)
|
||||
|
|
|
@ -99,6 +99,7 @@
|
|||
@show-address-details="showAddressDetails"
|
||||
@update:addresses="initUtxos"
|
||||
@search:tab="searchInTab"
|
||||
@update:note="updateNoteForAddress"
|
||||
:inkey="g.user.wallets[0].inkey"
|
||||
>
|
||||
</address-list>
|
||||
|
@ -200,7 +201,7 @@
|
|||
outline
|
||||
v-close-popup
|
||||
color="grey"
|
||||
@click="updateNoteForAddress(currentAddress, addressNote)"
|
||||
@click="updateNoteForAddress({addressId: currentAddress.id, note: addressNote})"
|
||||
class="q-ml-sm"
|
||||
>Save Note</q-btn
|
||||
>
|
||||
|
|
Loading…
Reference in New Issue
Block a user