sadpandajoe commented on code in PR #38069:
URL: https://github.com/apache/superset/pull/38069#discussion_r3827936721


##########
superset-frontend/packages/superset-ui-core/src/connection/SupersetClientClass.ts:
##########
@@ -115,19 +116,18 @@ export default class SupersetClientClass {
     return this.fetchCSRFToken();
   }
 
-  async postForm(
-    endpoint: string,
-    payload: Record<string, any>,
-    target = '_blank',
-  ) {
-    if (endpoint) {
+  async postForm(postFormConfig: PostFormConfig) {
+    if (postFormConfig.endpoint || postFormConfig.url) {
       await this.ensureAuth();
       const hiddenForm = document.createElement('form');
-      hiddenForm.action = this.getUrl({ endpoint });
+      hiddenForm.action = this.getUrl({
+        endpoint: postFormConfig.endpoint,
+        url: postFormConfig.url,
+      });
       hiddenForm.method = 'POST';
-      hiddenForm.target = target;
+      hiddenForm.target = postFormConfig.target ?? '_blank';
       const payloadWithToken: Record<string, any> = {

Review Comment:
   Agreed—the object-only signature makes existing JavaScript callers silently 
skip form submission, while TypeScript callers stop compiling. Could we retain 
a deprecated positional overload until a breaking-release migration?



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