@alexsab-ru/scripts 0.5.4 → 0.5.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.
- package/lib/form.js +5 -1
- package/package.json +1 -1
package/lib/form.js
CHANGED
|
@@ -191,9 +191,13 @@ document.querySelectorAll("form").forEach((form) => {
|
|
|
191
191
|
const requestData = await createRequest(ct_routeKey, phone.value, verbose);
|
|
192
192
|
formData.append("ct_callback", true);
|
|
193
193
|
formData.append("ctw_createRequest", JSON.stringify(requestData));
|
|
194
|
+
} else {
|
|
195
|
+
throw new Error('Empty ct_routeKey');
|
|
194
196
|
}
|
|
195
197
|
} catch (error) {
|
|
196
|
-
|
|
198
|
+
if(ct_routeKey != '') {
|
|
199
|
+
formData.append("ctw_createRequest", error);
|
|
200
|
+
}
|
|
197
201
|
verbose && console.error("Error during request Calltouch callback:", error);
|
|
198
202
|
formDataObj = getFormDataObject(formData, form.id);
|
|
199
203
|
}
|