nextemos 3.0.1 → 3.0.2
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.
|
@@ -43,7 +43,7 @@ const fetchRequest = () => {
|
|
|
43
43
|
Object.keys(params).forEach(key => apiURL.searchParams.append(key, params[key]));
|
|
44
44
|
if (method === __1.HTTPMethod.POST)
|
|
45
45
|
options.headers = Object.assign(Object.assign({}, options.headers), { ['Content-Type']: 'application/json' });
|
|
46
|
-
logger_1.default.
|
|
46
|
+
logger_1.default.info(`Fetch Request: ${method} - ${apiURL} - ${JSON.stringify(Object.assign({ cache: 'no-cache' }, options))}`);
|
|
47
47
|
try {
|
|
48
48
|
const response = yield fetch(apiURL.toString(), Object.assign(Object.assign({ cache: 'no-cache' }, options), { method }));
|
|
49
49
|
// Headers nesnesini Object'e dönüştürme
|
|
@@ -55,7 +55,7 @@ const fetchRequest = () => {
|
|
|
55
55
|
}
|
|
56
56
|
// response data nesnesini JSON'a dönüştürme.
|
|
57
57
|
const responseData = yield response.json().catch(() => ({}));
|
|
58
|
-
|
|
58
|
+
// logger.debug(`Fetch Response: ${JSON.stringify(responseData)}`);
|
|
59
59
|
if (!response.ok) {
|
|
60
60
|
const errorMessage = (responseData === null || responseData === void 0 ? void 0 : responseData.message) || 'Bir şeyler ters gitti!';
|
|
61
61
|
logger_1.default.error(`Fetch Request Error: ${response.status} - ${errorMessage}`);
|