Skip to content

Commit

Permalink
Assume download work type if not specified (#144)
Browse files Browse the repository at this point in the history
  • Loading branch information
Cito authored Jun 23, 2023
1 parent 63d90c3 commit bc1d091
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "data-portal-ui",
"version": "0.1.3",
"version": "0.1.4",
"private": true,
"dependencies": {
"@fortawesome/fontawesome-svg-core": "~6.4.0",
Expand Down
8 changes: 5 additions & 3 deletions src/components/workPackage/workPackage.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,10 @@ export function WorkPackage() {
console.log(error);
}
}
// assume work type "download" when not specified
datasets?.forEach(
(dataset) => (dataset.workType = dataset.workType || "download")
);
setDatasets(datasets);
}
fetchData();
Expand Down Expand Up @@ -160,9 +164,7 @@ export function WorkPackage() {

function handleSelect(id: string) {
setDataset(
id && datasets
? datasets.find((dataset) => dataset.id === id && dataset.workType)
: undefined
id && datasets ? datasets.find((dataset) => dataset.id === id) : undefined
);
}

Expand Down

0 comments on commit bc1d091

Please sign in to comment.