diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/utils/common.ts | 14 |
1 files changed, 6 insertions, 8 deletions
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<ContactType> = []; 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, + }); }); }); }); |