Skip to content

Commit 29c3942

Browse files
committed
refactor: salesforce contact update helpers
1 parent 387f70c commit 29c3942

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

includes/Actions/Salesforce/RecordApiHelper.php

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,16 +47,10 @@ public function insertContact($finalData, $update = false)
4747

4848
$response = HttpHelper::post($apiEndpoint, wp_json_encode($finalData), $this->_defaultHeader);
4949

50-
$duplicateRecordId = isset($response[0]->duplicateResult->matchResults[0]->matchRecords[0]->record->Id)
51-
? $response[0]->duplicateResult->matchResults[0]->matchRecords[0]->record->Id
52-
: null;
53-
54-
if (!$update || !$duplicateRecordId) {
50+
if (!$update) {
5551
return $response;
5652
}
5753

58-
$apiEndpoint = $apiEndpoint . '/' . $duplicateRecordId;
59-
6054
return apply_filters('btcbi_salesforce_update_record', $response, $apiEndpoint, $finalData, $this->_defaultHeader);
6155
}
6256

0 commit comments

Comments
 (0)