intelicoreact 1.4.16 → 1.4.18
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.
|
@@ -83,12 +83,18 @@ class RESTAPI extends _ApiBase.default {
|
|
|
83
83
|
function getCallback(item, mesageOptions) {
|
|
84
84
|
const {
|
|
85
85
|
getBodyAs
|
|
86
|
-
} = item;
|
|
87
|
-
const
|
|
88
|
-
|
|
86
|
+
} = item; // const finalIsGetBody = ('isGetBody' in item) ? item.isGetBody : isGetBody;
|
|
87
|
+
// const finalIsGetBodyFirst = ('isGetBody' in item) ? item.isGetBody === 'first' : isGetBodyFirst;
|
|
88
|
+
|
|
89
|
+
const finalIsGetBodyFirst = (() => {
|
|
90
|
+
if (item.isGetBody) return item.isGetBody && item.isGetBody === "first";
|
|
91
|
+
return isGetBodyFirst;
|
|
92
|
+
})();
|
|
93
|
+
|
|
89
94
|
const checkResponseCallback = finalIsGetBodyFirst ? async (res, mesageOptions) => API_CONTEXT.getResponseBody(await API_CONTEXT.checkResponseCode(res, mesageOptions), getBodyAs) : async (res, mesageOptions) => API_CONTEXT.checkResponseCode(res, mesageOptions);
|
|
90
|
-
const callback = item.callback ? async res => item.callback(await checkResponseCallback(res, mesageOptions)) : async res => checkResponseCallback(res, mesageOptions);
|
|
91
|
-
|
|
95
|
+
const callback = item.callback ? async res => item.callback(await checkResponseCallback(res, mesageOptions)) : async res => checkResponseCallback(res, mesageOptions); // return finalIsGetBody && !finalIsGetBodyFirst
|
|
96
|
+
|
|
97
|
+
return isGetBody && !isGetBodyFirst ? async res => API_CONTEXT.getResponseBody(await callback(res), getBodyAs) : callback;
|
|
92
98
|
}
|
|
93
99
|
|
|
94
100
|
async function getRequestItem(item, idx) {
|