File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -524,20 +524,20 @@ export function getAsPowerShellString(yasqe: Yasqe, _config?: Config["requestCon
524524 lines . push ( "}" ) ;
525525 } else if ( ajaxConfig . reqMethod === "POST" ) {
526526 // Extract the query/update parameter and other parameters separately
527- const queryParam = ajaxConfig . args . query || ajaxConfig . args . update ;
527+ // Determine the query parameter name first (query takes precedence over update)
528+ const queryParamName = ajaxConfig . args . query !== undefined ? "query" : "update" ;
529+ const queryParam = ajaxConfig . args [ queryParamName ] ;
530+
528531 const otherArgs : RequestArgs = { } ;
529532 for ( const key in ajaxConfig . args ) {
530533 if ( key !== "query" && key !== "update" ) {
531534 otherArgs [ key ] = ajaxConfig . args [ key ] ;
532535 }
533536 }
534537
535- // Determine the query parameter name
536- const queryParamName = ajaxConfig . args . query !== undefined ? "query" : "update" ;
537-
538538 // Build the query string using here-string for easy editing
539539 if ( queryParam ) {
540- // Handle both string and string[] cases
540+ // Handle both string and string[] cases - use first element if array
541541 const queryText = Array . isArray ( queryParam ) ? queryParam [ 0 ] : queryParam ;
542542 lines . push ( `$${ queryParamName } = @"` ) ;
543543 lines . push ( queryText ) ;
You can’t perform that action at this time.
0 commit comments