File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -26,8 +26,10 @@ class RESTAPIExecutor {
2626 buttons . forEach ( button => {
2727 button . addEventListener ( 'click' , ( e ) => {
2828 e . preventDefault ( ) ;
29- const operationId = button . dataset . operationId ;
30- this . executeRequest ( operationId ) ;
29+ const operationPanel = button . closest ( '[data-operation-panel]' ) ;
30+ if ( operationPanel ) {
31+ this . executeRequest ( operationPanel ) ;
32+ }
3133 } ) ;
3234 } ) ;
3335 }
@@ -53,13 +55,12 @@ class RESTAPIExecutor {
5355 }
5456
5557 /**
56- * Execute an API request for the given operation
57- * @param {string } operationId - The ID of the operation to execute
58+ * Execute an API request for the given operation panel
59+ * @param {Element } operationPanel - The operation panel element
5860 */
59- async executeRequest ( operationId ) {
60- const operationPanel = document . querySelector ( `[data-operation-id="${ operationId } "]` ) ;
61+ async executeRequest ( operationPanel ) {
6162 if ( ! operationPanel ) {
62- console . error ( ` Operation panel not found for ${ operationId } ` ) ;
63+ console . error ( ' Operation panel not found' ) ;
6364 return ;
6465 }
6566
You can’t perform that action at this time.
0 commit comments