codyml commented on code in PR #20498:
URL: https://github.com/apache/superset/pull/20498#discussion_r907834086


##########
superset-frontend/src/explore/actions/saveModalActions.js:
##########
@@ -60,33 +61,128 @@ export function removeSaveModalAlert() {
   return { type: REMOVE_SAVE_MODAL_ALERT };
 }
 
-export function saveSlice(formData, requestParams) {
-  return dispatch => {
-    const url = getExploreUrl({
-      formData,
-      endpointType: 'base',
-      force: false,
-      curUrl: null,
-      requestParams,
-    });
-
-    // Save the query context so we can re-generate the data from Python
-    // for alerts and reports
-    const queryContext = buildV1ChartDataPayload({
-      formData,
-      force: false,
-      resultFormat: 'json',
-      resultType: 'full',
-    });
-
-    return SupersetClient.post({
-      url,
-      postPayload: { form_data: formData, query_context: queryContext },
-    })
-      .then(response => {
-        dispatch(saveSliceSuccess(response.json));
-        return response.json;
-      })
-      .catch(() => dispatch(saveSliceFailed()));
+const getSlicePayload = (sliceName, formData) => {
+  const [datasourceId, datasourceType] = formData.datasource.split('__');
+  const payload = {
+    params: JSON.stringify(formData),
+    slice_name: sliceName,
+    viz_type: formData.viz_type,
+    datasource_id: +datasourceId,

Review Comment:
   Changed to `parseInt` for clarity.



-- 
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.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to