You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by GitBox <gi...@apache.org> on 2020/06/02 06:46:38 UTC

[GitHub] [incubator-superset] rusackas commented on a change in pull request #9903: feat: expand new chart data endpoint coverage

rusackas commented on a change in pull request #9903:
URL: https://github.com/apache/incubator-superset/pull/9903#discussion_r433654565



##########
File path: superset-frontend/src/chart/chartAction.js
##########
@@ -258,41 +331,31 @@ export function exploreJSON(
     const logStart = Logger.getTimestamp();
     const controller = new AbortController();
 
-    const useLegacyApi = shouldUseLegacyApi(formData);
-
-    let requestParams = {
+    const requestParams = {
       signal: controller.signal,
       timeout: timeout * 1000,
     };
+    if (dashboardId) requestParams.dashboard_id = dashboardId;
 
-    if (allowDomainSharding) {
-      requestParams = {
-        ...requestParams,
-        mode: 'cors',
-        credentials: 'include',
-      };
-    }
-
-    const queryPromiseRaw = useLegacyApi
-      ? legacyChartDataRequest(
-          formData,
-          force,
-          method,
-          dashboardId,
-          requestParams,
-        )
-      : v1ChartDataRequest(formData, force, requestParams);
+    const chartDataRequest = getChartDataRequest(
+      formData,
+      'json',
+      'full',
+      force,
+      method,
+      requestParams,
+    );
 
     dispatch(chartUpdateStarted(controller, formData, key));
 
-    const queryPromiseCaught = queryPromiseRaw
-      .then(({ json }) => {
+    const chartDataRequestCaught = chartDataRequest
+      .then(response => {
         // new API returns an object with an array of restults
-        // problem: json holds a list of results, when before we were just getting one result.
+        // problem: response holds a list of results, when before we were just getting one result.
         // `queryResponse` state is used all over the place.

Review comment:
       shoud this `queryResponse` be changed to `chartDataResponse` to keep things in step?




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org