This repository has been archived by the owner on Dec 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 972
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Payment History CSV export download has correct filename
simpler: export is just a data URL link, filename suggested by <a> `download` attribute depends on brave/ledger-client@d50d59e fixes #4332
- Loading branch information
Willy Bruns
committed
Sep 28, 2016
1 parent
7c44c28
commit 87ad861
Showing
3 changed files
with
17 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
const txUtil = require('ledger-client/util') | ||
const base64Encode = require('./base64').encode | ||
|
||
let transactionsToCSVDataURL = function (transactions) { | ||
let csvText = txUtil.getTransactionCSVText(transactions) | ||
return 'data:text/csv;base64,' + base64Encode(csvText) | ||
} | ||
|
||
module.exports = { | ||
transactionsToCSVRows: txUtil.getTransactionCSVRows, | ||
transactionsToCSVText: txUtil.getTransactionCSVText, | ||
transactionsToCSVDataURL: transactionsToCSVDataURL | ||
} |