File tree Expand file tree Collapse file tree 1 file changed +13
-10
lines changed
Expand file tree Collapse file tree 1 file changed +13
-10
lines changed Original file line number Diff line number Diff line change @@ -34,16 +34,19 @@ class PostSearchEndpoint {
3434 const url = this . fetchHelper . buildUrl ( '/search' ) ;
3535 this . logger . debug ( `Executing HTTP POST request against URL: ${ url } ` ) ;
3636
37- const response = await fetch (
38- url ,
39- this . fetchHelper . getDefaultPostOptions (
40- JSON . stringify ( {
41- steps : steps ,
42- parameters : parameters ,
43- debug : debug ,
44- } ) ,
45- ) ,
46- ) . catch ( ( error ) => this . fetchHelper . rethrowErrorAsNetworkError ( error ) ) ;
37+ const payload : Record < string , unknown > = {
38+ steps,
39+ } ;
40+ if ( parameters !== null ) {
41+ payload . parameters = parameters ;
42+ }
43+ if ( debug ) {
44+ payload . debug = true ;
45+ }
46+
47+ const response = await fetch ( url , this . fetchHelper . getDefaultPostOptions ( JSON . stringify ( payload ) ) ) . catch (
48+ ( error ) => this . fetchHelper . rethrowErrorAsNetworkError ( error ) ,
49+ ) ;
4750
4851 const rawData = await this . fetchHelper . parseJsonResponse ( response ) ;
4952
You can’t perform that action at this time.
0 commit comments