eschutho commented on a change in pull request #17044:
URL: https://github.com/apache/superset/pull/17044#discussion_r725322677



##########
File path: superset-frontend/src/views/CRUD/data/dataset/AddDatasetModal.tsx
##########
@@ -80,9 +79,21 @@ const DatasetModal: FunctionComponent<DatasetModalProps> = ({
     setTableName(tableName);
   };
 
+  const clearModal = () => {
+    setSchema('');
+    setTableName('');
+    setCurrentDatabase(undefined);
+    setDisableSave(true);
+  };
+
+  const hide = () => {
+    clearModal();
+    onHide();
+  };
+
   const onSave = () => {
     const data = {
-      database: datasourceId,
+      database: currentDatabase?.id || 0,

Review comment:
       what does setting the default to `0` do in this case, rather than 
undefined or null?




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