Skip to content

Commit 70d8bd7

Browse files
author
Omri Peleg
committed
Implemented rapidql
1 parent 3793d4e commit 70d8bd7

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

src/targets/rapidql/rapidql.js

Lines changed: 5 additions & 15 deletions
Original file line numberDiff line numberDiff 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(" }");

0 commit comments

Comments
 (0)