From f7e9af4e3a6937190dacc84f871090a36bbd5add Mon Sep 17 00:00:00 2001 From: Mikunj Date: Wed, 28 Nov 2018 11:45:27 +1100 Subject: [PATCH] Reverse changes to contact.js --- js/modules/types/contact.js | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/js/modules/types/contact.js b/js/modules/types/contact.js index a031c56eb..56baa425d 100644 --- a/js/modules/types/contact.js +++ b/js/modules/types/contact.js @@ -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; };