feat: show wallet payments on search (#3076)
This commit is contained in:
parent
1323a2005b
commit
10093bb465
2 changed files with 19 additions and 4 deletions
|
|
@ -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>
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue