feat: sort payments in wallet (#3642)
Co-authored-by: dni ⚡ <office@dnilabs.com>
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -29,6 +29,13 @@ window.app.component('lnbits-payment-list', {
|
||||
descending: true,
|
||||
rowsNumber: 10
|
||||
},
|
||||
sortFields: [
|
||||
{name: 'amount', label: 'Amount'},
|
||||
{name: 'fee', label: 'Fee'},
|
||||
{name: 'memo', label: 'Memo'},
|
||||
{name: 'time', label: 'Creation Date'},
|
||||
{name: 'updated_at', label: 'Last Updated'}
|
||||
],
|
||||
search: '',
|
||||
loading: false
|
||||
},
|
||||
@@ -243,6 +250,16 @@ window.app.component('lnbits-payment-list', {
|
||||
}
|
||||
})
|
||||
},
|
||||
sortByColumn(columnName) {
|
||||
if (this.paymentsTable.pagination.sortBy === columnName) {
|
||||
this.paymentsTable.pagination.descending =
|
||||
!this.paymentsTable.pagination.descending
|
||||
} else {
|
||||
this.paymentsTable.pagination.sortBy = columnName
|
||||
this.paymentsTable.pagination.descending = false
|
||||
}
|
||||
this.fetchPayments()
|
||||
},
|
||||
fetchPaymentsAsAdmin(walletId, params) {
|
||||
params = (params || '') + '&wallet_id=' + walletId
|
||||
return LNbits.api
|
||||
|
||||
Reference in New Issue
Block a user