Skip to content

Commit

Permalink
fix json out string and mimeTypes
Browse files Browse the repository at this point in the history
  • Loading branch information
JessyBarrette committed Nov 1, 2024
1 parent 6458c1d commit 1b4a1d5
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/components/FormComponents/MetadataRecordListItem.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ const MetadataRecordListItem = ({
} else if (fileType === "erddap") {
data = [recordToERDDAP(record)];
} else if (fileType === "json") {
data = await [JSON.stringify(record)];
} else if (fileType === "datacite-json") {
data = await [JSON.stringify(record, null, 2)];
} else if (fileType === "dataciteJson") {
data = await [JSON.stringify(recordToDataCite(record, language, region, datacitePrefix), null, 2)];
} else {
const res = await downloadRecord({ record, fileType, region });
Expand All @@ -115,6 +115,7 @@ const MetadataRecordListItem = ({
eml: "application/xml",
erddap: "application/xml",
json: "application/json",
dataciteJson: "application/json",
};
const blob = new Blob(data, {
type: `${mimeTypes[fileType]};charset=utf-8`,
Expand Down Expand Up @@ -392,7 +393,7 @@ const MetadataRecordListItem = ({
<MenuItem
key="json"
onClick={() => {
handleDownloadRecord("datacite-json");
handleDownloadRecord("dataciteJson");
handleClose();
}}
>
Expand Down

0 comments on commit 1b4a1d5

Please sign in to comment.