Skip to content

Commit

Permalink
fix(networks): unused var
Browse files Browse the repository at this point in the history
  • Loading branch information
ahonestla committed Oct 3, 2024
1 parent 93ddb3d commit fc6b531
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions client/src/pages/networks/hooks/useExportData.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,14 @@ const XSLXFormatter = (network: any) => {

XLSX.utils.book_append_sheet(workbook, XLSX.utils.json_to_sheet(network.items), "Items")
XLSX.utils.book_append_sheet(workbook, XLSX.utils.json_to_sheet(network.links), "Links")
XLSX.utils.book_append_sheet(
workbook,
XLSX.utils.json_to_sheet(
network.clusters.map((cluster) => {
const { publications, ...data } = cluster
return data
})
),
"Clusters"
)
XLSX.utils.book_append_sheet(workbook, XLSX.utils.json_to_sheet(network.clusters), "Clusters")

const publicationsList = network.clusters?.reduce((acc, cluster) => {
cluster?.publications.forEach((publication) => {
acc = [...acc, { id: publication.id, title: publication.title, cluster: cluster.cluster }]
})
return acc
}, [])

XLSX.utils.book_append_sheet(workbook, XLSX.utils.json_to_sheet(publicationsList), "Publications")

const workbookOutput = XLSX.write(workbook, { type: "binary", bookType: "xlsx" })
Expand Down

0 comments on commit fc6b531

Please sign in to comment.