File tree Expand file tree Collapse file tree
pages/api/paybutton/download/transactions Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -74,7 +74,11 @@ const formatPaybuttonTransactionsFileData = (data: TransactionFileData): Formatt
7474 }
7575}
7676
77- export const downloadPaybuttonTransactionsFile = async (
77+ const formatNumberHeaders = ( headers : string [ ] , currency : string ) : string [ ] => {
78+ return headers . map ( h => h === PAYBUTTON_TRANSACTIONS_FILE_HEADERS . value ? h + ` (${ currency . toUpperCase ( ) } )` : h )
79+ }
80+
81+ const downloadPaybuttonTransactionsFile = async (
7882 res : NextApiResponse ,
7983 paybutton : PaybuttonWithAddresses ,
8084 currency : SupportedQuotesType ) : Promise < void > => {
@@ -87,14 +91,14 @@ export const downloadPaybuttonTransactionsFile = async (
8791 return formatPaybuttonTransactionsFileData ( data )
8892 } )
8993 const headers = Object . keys ( PAYBUTTON_TRANSACTIONS_FILE_HEADERS )
90- const formmattedHeaders = Object . values ( PAYBUTTON_TRANSACTIONS_FILE_HEADERS )
94+ const humanReadableHeaders = Object . values ( PAYBUTTON_TRANSACTIONS_FILE_HEADERS )
9195
9296 streamToCSV (
9397 mappedTransactionsData ,
9498 headers ,
9599 DEFAULT_PAYBUTTON_CSV_FILE_DELIMITER ,
96100 res ,
97- formmattedHeaders
101+ formatNumberHeaders ( humanReadableHeaders , currency )
98102 )
99103}
100104
You can’t perform that action at this time.
0 commit comments