Reverse changes to contact.js

pull/61/head
Mikunj 6 years ago
parent b929b11f07
commit f7e9af4e3a

@ -66,7 +66,7 @@ function idForLogging(message) {
exports._validate = (contact, options = {}) => {
const { messageId } = options;
const { name, organization } = contact;
const { name, number, email, address, organization } = contact;
if ((!name || !name.displayName) && !organization) {
return new Error(
@ -74,16 +74,15 @@ exports._validate = (contact, options = {}) => {
);
}
// Disabled as we don't require the users to provide this
// if (
// (!number || !number.length) &&
// (!email || !email.length) &&
// (!address || !address.length)
// ) {
// return new Error(
// `Message ${messageId}: Contact had no included numbers, email or addresses`
// );
// }
if (
(!number || !number.length) &&
(!email || !email.length) &&
(!address || !address.length)
) {
return new Error(
`Message ${messageId}: Contact had no included numbers, email or addresses`
);
}
return null;
};

Loading…
Cancel
Save