You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "Antonio-RiveroMartnez (via GitHub)" <gi...@apache.org> on 2023/04/14 18:06:04 UTC

[GitHub] [superset] Antonio-RiveroMartnez commented on a diff in pull request #23678: chore(api v1): Deprecate datasource/save and datasource/get endpoints

Antonio-RiveroMartnez commented on code in PR #23678:
URL: https://github.com/apache/superset/pull/23678#discussion_r1167145713


##########
superset-frontend/src/components/Datasource/DatasourceModal.tsx:
##########
@@ -96,39 +96,81 @@ const DatasourceModal: FunctionComponent<DatasourceModalProps> = ({
       currentDatasource.schema;
 
     setIsSaving(true);
-    SupersetClient.post({
-      endpoint: '/datasource/save/',
-      postPayload: {
-        data: {
-          ...currentDatasource,
-          cache_timeout:
-            currentDatasource.cache_timeout === ''
-              ? null
-              : currentDatasource.cache_timeout,
-          schema,
-          metrics: currentDatasource?.metrics?.map(
-            (metric: Record<string, unknown>) => ({
-              ...metric,
+    SupersetClient.put({
+      endpoint: `/api/v1/dataset/${currentDatasource.id}`,
+      jsonPayload: {
+        table_name: currentDatasource.table_name,

Review Comment:
   Why are we not spreading as we were before? same with metric and column below.



-- 
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: notifications-unsubscribe@superset.apache.org

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