sort CSV export of payments (#2208)

This commit is contained in:
Pavol Rusnak 2024-01-22 08:03:31 -06:00 committed by GitHub
parent 26ca8c71d7
commit a3b7c76523
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -780,7 +780,7 @@ new Vue({
if (props) {
this.paymentsTable.pagination = props.pagination
}
let pagination = this.paymentsTable.pagination
const pagination = this.paymentsTable.pagination
this.paymentsTable.loading = true
const query = {
limit: pagination.rowsPerPage,
@ -836,7 +836,12 @@ new Vue({
// status is important for export but it is not in paymentsTable
// because it is manually added with payment detail link and icons
// and would cause duplication in the list
LNbits.api.getPayments(this.g.wallet, {}).then(response => {
const pagination = this.paymentsTable.pagination
const query = {
sortby: pagination.sortBy ?? 'time',
direction: pagination.descending ? 'desc' : 'asc'
}
LNbits.api.getPayments(this.g.wallet, query).then(response => {
const payments = response.data.data.map(LNbits.map.payment)
LNbits.utils.exportCSV(
this.paymentsCSV.columns,