Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions samples/dedupe_contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ exports.main = (event, callback) => {
hubspotClient.crm.contacts.basicApi
.getById(event.object.objectId, [DEDUPE_PROPERTY])
.then(contactResult => {
let dedupePropValue = contactResult.body.properties[DEDUPE_PROPERTY];
let dedupePropValue = contactResult.properties[DEDUPE_PROPERTY];

console.log(`Looking for duplicates based on ${DEDUPE_PROPERTY} = ${dedupePropValue}`);
hubspotClient.crm.contacts.searchApi
Expand All @@ -32,7 +32,7 @@ exports.main = (event, callback) => {
}]
})
.then(searchResults => {
let idsToMerge = searchResults.body.results
let idsToMerge = searchResults.results
.map(object => object.id)
.filter(vid => Number(vid) !== Number(event.object.objectId));

Expand Down