Send default tempVars value with :interval: from data explorer csv download

pull/10616/head
deniz kusefoglu 2018-02-13 15:49:59 -05:00
parent 374878f626
commit 127c9c9201
1 changed files with 17 additions and 1 deletions

View File

@ -8,7 +8,23 @@ import download from 'src/external/download.js'
const getCSV = (query, errorThrown) => async () => {
try {
const {results} = await fetchTimeSeriesAsync({source: query.host, query})
const tempVars = [
{
id: 'interval',
type: 'autoGroupBy',
tempVar: ':interval:',
label: 'automatically determine the best group by time',
values: [
{value: '1000', type: 'resolution', selected: true},
{value: '3', type: 'pointsPerPixel', selected: true},
],
},
]
const {results} = await fetchTimeSeriesAsync({
source: query.host,
query,
tempVars,
})
const {flag, name, CSVString} = resultsToCSV(results)
if (flag === 'no_data') {
errorThrown('no data', 'There are no data to download.')