@teamdigipay/dgepay-customer-transaction-package 0.0.4 → 0.0.5
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.
|
@@ -17,7 +17,7 @@ const DatadogTxn_1 = require("../utils/DatadogTxn");
|
|
|
17
17
|
const netinfo_1 = require("@react-native-community/netinfo");
|
|
18
18
|
const Strings_1 = require("../utils/Strings");
|
|
19
19
|
exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(void 0, void 0, void 0, function* () {
|
|
20
|
-
var _a, _b, _c;
|
|
20
|
+
var _a, _b, _c, _d;
|
|
21
21
|
const isConnected = yield netinfo_1.default.fetch();
|
|
22
22
|
console.log('Internet connection', isConnected);
|
|
23
23
|
if (!isConnected.isConnected) {
|
|
@@ -59,12 +59,9 @@ exports.default = (apiConfig, apiPayload, onSuccess, onFailure) => __awaiter(voi
|
|
|
59
59
|
// headers = { ...apiPayload.headersFlutterWave }
|
|
60
60
|
// }
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
// "Content-Type": "multipart/form-data",
|
|
66
|
-
// };
|
|
67
|
-
// }
|
|
62
|
+
if ((_d = apiPayload === null || apiPayload === void 0 ? void 0 : apiPayload.data) === null || _d === void 0 ? void 0 : _d._parts) {
|
|
63
|
+
headers = Object.assign(Object.assign({}, headers), { "Content-Type": "multipart/form-data" });
|
|
64
|
+
}
|
|
68
65
|
let config = {
|
|
69
66
|
baseURL: endPoint,
|
|
70
67
|
timeout: apiConfig.timeout || 6000000000,
|
package/package.json
CHANGED
|
@@ -56,7 +56,7 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
56
56
|
success: false
|
|
57
57
|
})
|
|
58
58
|
console.log('Please, Check your Internet Connection..!!!!!!!!!!!!!!!')
|
|
59
|
-
}
|
|
59
|
+
}
|
|
60
60
|
else{
|
|
61
61
|
const method: METHOD = apiConfig.method || "get";
|
|
62
62
|
|
|
@@ -101,12 +101,12 @@ const isConnected: NetInfoState = await NetInfo.fetch()
|
|
|
101
101
|
// }
|
|
102
102
|
}
|
|
103
103
|
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
104
|
+
if (apiPayload?.data?._parts) {
|
|
105
|
+
headers = {
|
|
106
|
+
...headers,
|
|
107
|
+
"Content-Type": "multipart/form-data",
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
110
|
|
|
111
111
|
|
|
112
112
|
|