Skip to content

Commit

Permalink
chore: code review changes
Browse files Browse the repository at this point in the history
  • Loading branch information
mihir-4116 committed Nov 6, 2023
1 parent 0ea8b2b commit bdd8380
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 9 deletions.
5 changes: 3 additions & 2 deletions src/cdk/v2/destinations/gladly/rtWorkflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@ steps:

- name: successfulEvents
template: |
const status = $.getStatusCode($.requestMetadata, $.outputs.transform#idx.output.status)
$.outputs.transform#idx.output.({
"batchedRequest": $.getPayload(.),
"batchedRequest": .{~["status"]},
"batched": false,
"destination": ^[idx].destination,
"metadata": ^[idx].metadata[],
"statusCode": $.getStatusCode($.requestMetadata, $.outputs.transform#idx.output.status)
"statusCode": status
})[]
- name: failedEvents
template: |
Expand Down
8 changes: 1 addition & 7 deletions src/cdk/v2/destinations/gladly/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,10 +53,4 @@ const getStatusCode = (requestMetadata, statusCode) => {
return statusCode;
}

const getPayload = (eventPayload) => {
const payload = eventPayload;
delete payload.status;
return payload;
}

module.exports = { formatField, getCustomAttributes, getEndpoint, getHeaders, getStatusCode, getPayload };
module.exports = { formatField, getCustomAttributes, getEndpoint, getHeaders, getStatusCode };

0 comments on commit bdd8380

Please sign in to comment.