I37 bulk download - #39
Conversation
Nospamas
left a comment
There was a problem hiding this comment.
Setting to request changes for small feedback.
| const filename = `${outletId}_${direction}_${selections.model}_${selections.scenario}_${apiVariable}.nc` | ||
| .replace(/[^A-Za-z0-9_.-]+/g, "_"); | ||
| const url = URL.createObjectURL(blob); | ||
| const a = document.createElement("a"); |
There was a problem hiding this comment.
Seperation of concerns is a bit broken here, API surface maybe shouldn't be generating html content (leave that to JSX/React) but if you have good reason I'll allow it.
There was a problem hiding this comment.
I see what you mean. I had followed the existing patterns for the single-timeseries and GeoJSON downloads that used a temporary anchor to trigger the browser download.
I’ve moved this out of the API services and into a shared download utility, and updated the three download paths.
The single-timeseries API returns a download URL and filename, while the bulk NetCDF and GeoJSON APIs return a blob and filename. InteractionLayer and DataSelectionTable initiate their respective downloads.
Nospamas
left a comment
There was a problem hiding this comment.
Looks cleaner, approved 👍
Resolves #37