Skip to content

Commit

Permalink
fix(results): 🐛 Result parsing csv
Browse files Browse the repository at this point in the history
  • Loading branch information
baptisteArno committed Mar 16, 2022
1 parent fb3d2bc commit c437211
Showing 1 changed file with 11 additions and 3 deletions.
14 changes: 11 additions & 3 deletions apps/builder/layouts/results/SubmissionContent.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,17 @@ export const SubmissionsContent = ({
const dataToUnparse = isSelectAll
? await getAllTableData()
: tableData.filter((_, idx) => selectedIndices.includes(idx))
const csvData = new Blob([unparse(dataToUnparse)], {
type: 'text/csv;charset=utf-8;',
})
const csvData = new Blob(
[
unparse({
data: dataToUnparse,
fields: resultHeader.map((h) => h.label),
}),
],
{
type: 'text/csv;charset=utf-8;',
}
)
const fileName =
`typebot-export_${new Date().toLocaleDateString().replaceAll('/', '-')}` +
(isSelectAll ? `_all` : ``)
Expand Down

2 comments on commit c437211

@vercel
Copy link

@vercel vercel bot commented on c437211 Mar 16, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

builder-v2 – ./apps/builder

builder-v2-git-main-typebot-io.vercel.app
builder-v2-typebot-io.vercel.app
app.typebot.io

Please sign in to comment.