drapcode-utility 2.5.0-preview → 2.5.1-preview
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -155,7 +155,7 @@ const callCurlRequest = async (setting, user = {}, tenant = {}, userSetting = {}
|
|
|
155
155
|
return prepareReturnObject(result.data, result.status, result?.success || (result.status >= 200 && result.status < 300), result?.headers, result?.mysqlError);
|
|
156
156
|
}
|
|
157
157
|
else {
|
|
158
|
-
result = await makeAxiosCall(projectId, methodType, url, headerValue, data, timeout, wrapJsonDataInArray, awsSignPluginConfig);
|
|
158
|
+
result = await makeAxiosCall(projectId, methodType, url, headerValue, data, timeout, wrapJsonDataInArray, awsSignPluginConfig, dtoExternalAPI);
|
|
159
159
|
}
|
|
160
160
|
drapcode_logger_1.logger.info(`result.headers: ${result?.headers}`, { label: projectId });
|
|
161
161
|
if (!result) {
|
|
@@ -234,14 +234,19 @@ const prepareReturnObject = (data, status = 400, success = false, headers = {},
|
|
|
234
234
|
};
|
|
235
235
|
}
|
|
236
236
|
};
|
|
237
|
-
const makeAxiosCall = async (projectId, methodType, url, axiosConfig, data, timeout, wrapJsonDataInArray, awsSignPluginConfig) => {
|
|
237
|
+
const makeAxiosCall = async (projectId, methodType, url, axiosConfig, data, timeout, wrapJsonDataInArray, awsSignPluginConfig, dtoExternalAPI) => {
|
|
238
238
|
axiosConfig = { url, method: methodType, ...axiosConfig };
|
|
239
239
|
let result = "";
|
|
240
240
|
const instance = axios_1.default.create();
|
|
241
241
|
instance.defaults.timeout = timeout * 1000;
|
|
242
|
+
const { dtoBodyDataFrom } = dtoExternalAPI || {};
|
|
243
|
+
const isNoBodyData = !dtoBodyDataFrom || dtoBodyDataFrom === "noDynamicData";
|
|
244
|
+
console.log(`\n ==> isNoBodyData for projectID: ${projectId}:`, isNoBodyData);
|
|
242
245
|
switch (methodType) {
|
|
243
246
|
case "GET":
|
|
244
|
-
|
|
247
|
+
if (!isNoBodyData) {
|
|
248
|
+
axiosConfig["data"] = data ? data : {};
|
|
249
|
+
}
|
|
245
250
|
break;
|
|
246
251
|
case "POST":
|
|
247
252
|
case "PUT":
|