Skip to content

Commit

Permalink
chore: no success should return empty array for linkedin ads (#3238)
Browse files Browse the repository at this point in the history
chore: no success should return empty array
  • Loading branch information
shrouti1507 authored Apr 2, 2024
1 parent 476b401 commit aaddac1
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
13 changes: 5 additions & 8 deletions src/cdk/v2/destinations/linkedin_ads/rtWorkflow.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
bindings:
- path: ./utils
- path: ./config
- name: handleRtTfSingleEventError
path: ../../../../v0/util/index

steps:
- name: validateInput
Expand All @@ -23,14 +25,9 @@ steps:
})[]
- name: failedEvents
template: |
$.outputs.transform#idx.error.({
"metadata": ^[idx].metadata[],
"destination": ^[idx].destination,
"batched": false,
"statusCode": .status,
"error": .message,
"statTags": .originalError.statTags
})[]
$.outputs.transform#idx.error.(
$.handleRtTfSingleEventError(^[idx], .originalError ?? ., {})
)[]
- name: batchSuccessfulEvents
description: Batches the successfulEvents
Expand Down
3 changes: 3 additions & 0 deletions src/cdk/v2/destinations/linkedin_ads/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,9 @@ const fetchAndVerifyConversionHappenedAt = (message) => {
};

function batchResponseBuilder(successfulEvents) {
if (successfulEvents.length === 0) {
return [];

Check warning on line 166 in src/cdk/v2/destinations/linkedin_ads/utils.js

View check run for this annotation

Codecov / codecov/patch

src/cdk/v2/destinations/linkedin_ads/utils.js#L166

Added line #L166 was not covered by tests
}
const constants = {
version: successfulEvents[0].message[0].version,
type: successfulEvents[0].message[0].type,
Expand Down

0 comments on commit aaddac1

Please sign in to comment.