@modulbank/sendamo
Advanced tools
Comparing version 0.0.26-beta-sm-8778-integration-with-cityes-add-6a319546 to 0.0.26-beta-sm-8778-integration-with-cityes-add-9bedf3ab
@@ -103,17 +103,22 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
url.searchParams.set('click_id', clickId); | ||
// @ts-ignore | ||
fetch(url.toString(), { | ||
method: 'GET' | ||
}) | ||
.then((response) => __awaiter(this, void 0, void 0, function* () { | ||
if (response.status === 200) { | ||
resolve(response); | ||
const xhr = new XMLHttpRequest(); | ||
xhr.open('GET', url.toString(), true); | ||
xhr.onload = function () { | ||
if (xhr.status === 200) { | ||
resolve(xhr.responseText); | ||
} | ||
else { | ||
throw new Error(yield response.json()); | ||
try { | ||
const errorResponse = JSON.parse(xhr.responseText); | ||
reject(new Error(errorResponse)); | ||
} | ||
catch (error) { | ||
reject(new Error(xhr.responseText)); | ||
} | ||
} | ||
})) | ||
.catch((err) => { | ||
reject(err); | ||
}); | ||
}; | ||
xhr.onerror = function () { | ||
reject(new Error('Network error occurred.')); | ||
}; | ||
xhr.send(); | ||
}); | ||
@@ -120,0 +125,0 @@ } |
{ | ||
"name": "@modulbank/sendamo", | ||
"version": "0.0.26-beta-sm-8778-integration-with-cityes-add-6a319546", | ||
"version": "0.0.26-beta-sm-8778-integration-with-cityes-add-9bedf3ab", | ||
"description": "send to amocrm method", | ||
@@ -5,0 +5,0 @@ "homepage": "", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9268
207
1