tango-app-api-audio-analytics 1.0.11 → 1.0.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
// import { sampleConversationData, sampleConversationsList } from '../models/conversationAnalysis.model.js';
|
|
2
|
-
import { logger } from 'tango-app-api-middleware';
|
|
2
|
+
import { logger, downloadint } from 'tango-app-api-middleware';
|
|
3
3
|
import {
|
|
4
4
|
getConversationsListFromLambda,
|
|
5
5
|
exportConversationsFromLambda,
|
|
6
6
|
getConversationDetailsFromLambda,
|
|
7
|
-
exportConversationsToCSV,
|
|
8
7
|
// filterConversationsBySearch,
|
|
9
8
|
// sortConversations,
|
|
10
9
|
} from '../services/conversation.service.js';
|
|
@@ -94,11 +93,9 @@ export const getConversationsList = async ( req, res ) => {
|
|
|
94
93
|
// // Apply sorting
|
|
95
94
|
// conversations = sortConversations( conversations, 'date', 'desc' );
|
|
96
95
|
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
res.setHeader( 'Content-Disposition', 'attachment; filename=conversations.csv' );
|
|
101
|
-
return res.send( csv );
|
|
96
|
+
res.setHeader( 'Content-Type', 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' );
|
|
97
|
+
res.setHeader( 'Content-Disposition', `attachment; filename=conversations-${Date.now()}.xlsx` );
|
|
98
|
+
return downloadint( exportResponse.data, res );
|
|
102
99
|
} catch ( error ) {
|
|
103
100
|
logger.error( { error, message: 'Error in export Lambda call', body: req.body } );
|
|
104
101
|
throw error;
|