fix: handle mixed time-series error (#16928)

* rebase to master

* Fix line 402

Co-authored-by: yougyoung <yougyoung@pubg.com>
This commit is contained in:
Youkyoung Cha 2021-10-05 22:00:22 +09:00 committed by GitHub
parent 82601abe17
commit 93ebe3d963
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 2 deletions

View File

@ -395,13 +395,16 @@ export function exploreJSON(
.then(({ response, json }) => {
if (isFeatureEnabled(FeatureFlag.GLOBAL_ASYNC_QUERIES)) {
// deal with getChartDataRequest transforming the response data
const result = 'result' in json ? json.result[0] : json;
const result = 'result' in json ? json.result : json;
switch (response.status) {
case 200:
// Query results returned synchronously, meaning query was already cached.
return Promise.resolve([result]);
return Promise.resolve(result);
case 202:
// Query is running asynchronously and we must await the results
if (shouldUseLegacyApi(formData)) {
return waitForAsyncData(result[0]);
}
return waitForAsyncData(result);
default:
throw new Error(