fix(http): get time series data properly

pull/10616/head
Michael Desa 2018-08-02 17:09:13 -04:00 committed by Andrew Watkins
parent fcb930e19b
commit 3b400952d9
2 changed files with 4 additions and 3 deletions

View File

@ -50,10 +50,11 @@ interface GetTimeSeriesResult {
export const getTimeSeries = async (
url: string, // query URI
script: string
query: string
): Promise<GetTimeSeriesResult> => {
let responseBody: string
let responseByteLength: number
const type = 'flux'
try {
// We are using the `fetch` API here since the `AJAX` utility lacks support
@ -64,7 +65,7 @@ export const getTimeSeries = async (
// https://github.com/axios/axios/issues/1491.
const resp = await fetch(url, {
method: 'POST',
body: JSON.stringify({script}),
body: JSON.stringify({query, type}),
})
const {body, byteLength} = await decodeFluxRespWithLimit(resp)

View File

@ -4,7 +4,7 @@ import (
"encoding/json"
"net/http"
query "github.com/desa/platform/query/builtin"
query "github.com/influxdata/platform/query/builtin"
"github.com/influxdata/platform/query/parser"
"github.com/julienschmidt/httprouter"
)