feat: show wallet payments on search (#3076)

This commit is contained in:
Vlad Stan 2025-04-01 13:41:10 +03:00 committed by GitHub
parent 1323a2005b
commit 10093bb465
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 19 additions and 4 deletions

View file

@ -127,7 +127,17 @@
:label="props.row.wallet_count" :label="props.row.wallet_count"
@click="fetchWallets(props.row.id)" @click="fetchWallets(props.row.id)"
> >
<q-tooltip>Show Wallets</q-tooltip> </q-btn>
<q-btn
v-if="(users.length == 1) && searchData.wallet_id"
round
icon="menu"
size="sm"
color="secondary"
class="q-ml-sm"
@click="showWalletPayments(searchData.wallet_id)"
>
<q-tooltip>Show Payments</q-tooltip>
</q-btn> </q-btn>
</q-td> </q-td>

View file

@ -329,7 +329,7 @@ window.UsersPageLogic = {
.catch(LNbits.utils.notifyApiError) .catch(LNbits.utils.notifyApiError)
}, },
fetchWallets(userId) { fetchWallets(userId) {
LNbits.api return LNbits.api
.request('GET', `/users/api/v1/user/${userId}/wallet`) .request('GET', `/users/api/v1/user/${userId}/wallet`)
.then(res => { .then(res => {
this.wallets = res.data this.wallets = res.data
@ -378,8 +378,13 @@ window.UsersPageLogic = {
this.activeUser.show = false this.activeUser.show = false
} }
}, },
showPayments(wallet_id) { async showWalletPayments(walletId) {
this.paymentsWallet = this.wallets.find(wallet => wallet.id === wallet_id) this.activeUser.show = false
await this.fetchWallets(this.users[0].id)
await this.showPayments(walletId)
},
showPayments(walletId) {
this.paymentsWallet = this.wallets.find(wallet => wallet.id === walletId)
this.paymentPage.show = true this.paymentPage.show = true
}, },
searchUserBy(fieldName) { searchUserBy(fieldName) {