From 5bb8376cd6f3c87af8011c6d523c5a32813970fb Mon Sep 17 00:00:00 2001 From: Shravya Ramesh Date: Thu, 18 Mar 2021 16:33:22 -0700 Subject: fix --- src/utils/common.ts | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'src') diff --git a/src/utils/common.ts b/src/utils/common.ts index 5f0e26ba..0a76ec08 100644 --- a/src/utils/common.ts +++ b/src/utils/common.ts @@ -121,14 +121,12 @@ export const extractContacts = async () => { let retrievedContacts: Array = []; await getAll().then((contacts) => { contacts.map((contact) => { - let obj: ContactType = { - first_name: contact.givenName, - last_name: contact.familyName, - }; - contact.phoneNumbers.map(async (phoneNumber) => { - obj.phone_number = phoneNumber.number; - retrievedContacts.push(obj); - console.log('contact: ', obj); + contact.phoneNumbers.map((phoneNumber) => { + retrievedContacts.push({ + first_name: contact.givenName, + last_name: contact.familyName, + phone_number: phoneNumber.number, + }); }); }); }); -- cgit v1.2.3-70-g09d2