n8n-nodes-idb2b 3.1.1 → 3.1.3
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.
|
@@ -106,7 +106,7 @@ class IDB2B {
|
|
|
106
106
|
const email = this.getNodeParameter("email", i);
|
|
107
107
|
const phone_number = this.getNodeParameter("phone_number", i, "");
|
|
108
108
|
const additionalFields = this.getNodeParameter("additionalFields", i, {});
|
|
109
|
-
const validation = validator.validateContactData(name, email, phone_number,
|
|
109
|
+
const validation = validator.validateContactData(name, email, phone_number, false);
|
|
110
110
|
if (!validation.isValid) {
|
|
111
111
|
throw new Error(validation.error);
|
|
112
112
|
}
|
|
@@ -58,7 +58,7 @@ class ContactHandler {
|
|
|
58
58
|
*/
|
|
59
59
|
async create(params) {
|
|
60
60
|
// Validate required fields
|
|
61
|
-
const validation = this.validator.validateContactData(params.data.name, params.data.email, params.data.phone_number,
|
|
61
|
+
const validation = this.validator.validateContactData(params.data.name, params.data.email, params.data.phone_number, false);
|
|
62
62
|
if (!validation.isValid) {
|
|
63
63
|
throw new Error(validation.error);
|
|
64
64
|
}
|
|
@@ -117,9 +117,11 @@ function buildContactRequestBody(data, includesPhone = true) {
|
|
|
117
117
|
if (data.name !== undefined) {
|
|
118
118
|
body.name = typeof data.name === "string" ? data.name.trim() : data.name;
|
|
119
119
|
}
|
|
120
|
-
if (data.email !== undefined) {
|
|
120
|
+
if (data.email !== undefined && data.email !== "") {
|
|
121
121
|
body.email =
|
|
122
122
|
typeof data.email === "string" ? data.email.trim() : data.email;
|
|
123
|
+
if (body.email === "")
|
|
124
|
+
delete body.email;
|
|
123
125
|
}
|
|
124
126
|
// Include phone if provided
|
|
125
127
|
if (includesPhone &&
|