From e394406b9812d93a1e1d0b0967dd7242505c1054 Mon Sep 17 00:00:00 2001 From: Da Kong Date: Mon, 2 Sep 2024 10:22:26 +0800 Subject: [PATCH] fix: fixed tests --- src/index.js | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/index.js b/src/index.js index 37d8aa0a..5d527c37 100644 --- a/src/index.js +++ b/src/index.js @@ -313,9 +313,12 @@ app.get('/contact', async function (req, res) { platformName = platform; const { successful, returnMessage, contact } = await contactCore.findContact({ platform, userId, phoneNumber: req.query.phoneNumber, overridingFormat: req.query.overridingFormat }); res.status(200).send({ successful, returnMessage, contact }); - const nonNewContact = contact.filter(c => !c.isNewContact); - resultCount = nonNewContact.length; - success = true; + if(successful) + { + const nonNewContact = contact.filter(c => !c.isNewContact); + resultCount = nonNewContact.length; + success = true; + } } else { res.status(400).send('Please go to Settings and authorize CRM platform');