@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.
Files changed (2) hide show
  1. package/lib/form.js +5 -1
  2. 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
- formData.append("ctw_createRequest", error);
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
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alexsab-ru/scripts",
3
- "version": "0.5.4",
3
+ "version": "0.5.5",
4
4
  "description": "common libs for websites",
5
5
  "main": "index.js",
6
6
  "scripts": {