Skip to content

Commit

Permalink
Merge pull request #3037 from aiidtest/fix-discover-crash
Browse files Browse the repository at this point in the history
Prevent CSV export from crashing on missing fields
  • Loading branch information
pdcp1 committed Aug 23, 2024
2 parents f1a807a + a7a8b10 commit 0470e73
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions site/gatsby-site/src/components/discover/CsvExport.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,10 @@ const convertData = (hits) => {
'incident id': hit.incident_id,
'report number': hit.report_number,
title: hit.title,
'date published': format(fromUnixTime(hit.epoch_date_published), 'yyyy-MM-dd'),
'date submitted': format(fromUnixTime(hit.epoch_date_submitted), 'yyyy-MM-dd'),
'date modified': format(fromUnixTime(hit.epoch_date_modified), 'yyyy-MM-dd'),
'date downloaded': format(fromUnixTime(hit.epoch_date_downloaded), 'yyyy-MM-dd'),
'date published': format(fromUnixTime(hit.epoch_date_published ?? 0), 'yyyy-MM-dd'),
'date submitted': format(fromUnixTime(hit.epoch_date_submitted ?? 0), 'yyyy-MM-dd'),
'date modified': format(fromUnixTime(hit.epoch_date_modified ?? 0), 'yyyy-MM-dd'),
'date downloaded': format(fromUnixTime(hit.epoch_date_downloaded ?? 0), 'yyyy-MM-dd'),
url: hit.url,
'source domain': hit.source_domain,
language: hit.language,
Expand Down

0 comments on commit 0470e73

Please sign in to comment.