nytai commented on a change in pull request #13342:
URL: https://github.com/apache/superset/pull/13342#discussion_r594734243
##########
File path: superset-frontend/src/views/CRUD/hooks.ts
##########
@@ -605,3 +610,28 @@ export const copyQueryLink = (
addDangerToast(t('Sorry, your browser does not support copying.'));
});
};
+
+export const testDatabaseConnection = (
+ connection: DatabaseObject,
+ handleErrorMsg: (errorMsg: string) => void,
+ addSuccessToast: (arg0: string) => void,
+) => {
+ SupersetClient.post({
+ endpoint: 'api/v1/database/test_connection',
+ body: JSON.stringify(connection),
+ headers: { 'Content-Type': 'application/json' },
Review comment:
nit: you can use `'postPayload` with a js object, instead of body + json
header
----------------------------------------------------------------
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:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]