mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-02-23 22:47:05 +01:00
Fix csv export (#1852)
* fetch all payments for csv export * include fiat amount and currency in export
This commit is contained in:
parent
f096b51f70
commit
3aef1605be
1 changed files with 21 additions and 7 deletions
|
@ -175,6 +175,12 @@ new Vue({
|
|||
},
|
||||
paymentsCSV: {
|
||||
columns: [
|
||||
{
|
||||
name: 'pending',
|
||||
align: 'left',
|
||||
label: 'Pending',
|
||||
field: 'pending'
|
||||
},
|
||||
{
|
||||
name: 'memo',
|
||||
align: 'left',
|
||||
|
@ -224,6 +230,18 @@ new Vue({
|
|||
align: 'right',
|
||||
label: this.$t('webhook'),
|
||||
field: 'webhook'
|
||||
},
|
||||
{
|
||||
name: 'fiat_currency',
|
||||
align: 'right',
|
||||
label: 'Fiat Currency',
|
||||
field: row => row.extra.wallet_fiat_currency
|
||||
},
|
||||
{
|
||||
name: 'fiat_amount',
|
||||
align: 'right',
|
||||
label: 'Fiat Amount',
|
||||
field: row => row.extra.wallet_fiat_amount
|
||||
}
|
||||
],
|
||||
filter: null,
|
||||
|
@ -792,14 +810,10 @@ 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
|
||||
let columns = structuredClone(this.paymentsCSV.columns)
|
||||
columns.unshift({
|
||||
name: 'pending',
|
||||
align: 'left',
|
||||
label: 'Pending',
|
||||
field: 'pending'
|
||||
LNbits.api.getPayments(this.g.wallet, {}).then(response => {
|
||||
const payments = response.data.data.map(LNbits.map.payment)
|
||||
LNbits.utils.exportCSV(this.paymentsCSV.columns, payments)
|
||||
})
|
||||
LNbits.utils.exportCSV(columns, this.payments)
|
||||
},
|
||||
pasteToTextArea: function () {
|
||||
navigator.clipboard.readText().then(text => {
|
||||
|
|
Loading…
Add table
Reference in a new issue