File tree Expand file tree Collapse file tree 1 file changed +5
-15
lines changed
Expand file tree Collapse file tree 1 file changed +5
-15
lines changed Original file line number Diff line number Diff line change @@ -27,26 +27,16 @@ module.exports = function (source, options) {
2727 lines . push ( ` headers : {\n${ Object . entries ( source . allHeaders ) . map ( ( [ key , val ] ) => `"${ key } ":"${ val } "` ) . join ( ",\n" ) } \n }` ) ;
2828 }
2929
30- // if (parameters.length) {
31- // appendComma(lines.length - 1);
32- // lines.push(` form : {\n${parameters.join(",\n")}\n }`);
33- // }
3430
35- if ( source ?. postData ?. text ) {
31+ if ( source ?. postData ?. jsonObj ) {
3632 code . push ( ` json: true,` )
3733 code . push ( ` body: ${ source ?. postData ?. text } ` )
34+ } else if ( source ?. postData ?. params ) {
35+ code . push ( ` form : {\n${ Object . entries ( source . postData . params ) . map ( ( [ key , val ] ) => `"${ key } ":"${ val } "` ) . join ( ",\n" ) } \n }` ) ;
36+ } else {
37+ code . push ( ` body : ${ source ?. postData ?. text } ` ) ;
3838 }
3939
40- // builder.forPayload((payload) => {
41- // appendComma(lines.length - 1);
42- // if (payload.format === "JSON") {
43- // lines.push(` json : true,`);
44- // lines.push(` body : ${helpers.escapePayload(payload, true)}`);
45- // } else {
46- // lines.push(` body : "${helpers.escapePayload(payload)}"`);
47- // }
48- // });
49-
5040 code . push ( " ) {" ) ;
5141 code . push ( "" ) ;
5242 code . push ( " }" ) ;
You can’t perform that action at this time.
0 commit comments