Skip to content

Commit

Permalink
#1742: correctly retrieve all related transactionalEmails after publi…
Browse files Browse the repository at this point in the history
…shing a transactional send journey
  • Loading branch information
JoernBerkefeld committed Sep 26, 2024
1 parent 54c274c commit d7c410b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 2 deletions.
2 changes: 1 addition & 1 deletion @types/lib/metadataTypes/Journey.d.ts.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 11 additions & 1 deletion lib/metadataTypes/Journey.js
Original file line number Diff line number Diff line change
Expand Up @@ -1871,8 +1871,18 @@ class Journey extends MetadataType {
['journey'],
transactionalKeyArr
);

/** @type {MetadataTypeItem[]} */
const updatedJourneys = Object.values(updatedJourneyRetrieve?.journey[0]);
const updatedJourneys =
updatedJourneyRetrieve?.journey?.length > 1
? Object.values(
updatedJourneyRetrieve?.journey.reduce(
(previousValue, currentValue) =>
Object.assign(previousValue, currentValue),
{}
)
)
: Object.values(updatedJourneyRetrieve?.journey[0]);
if (updatedJourneys) {
const updatedTransactionalEmails = [];
for (const journey of updatedJourneys) {
Expand Down

0 comments on commit d7c410b

Please sign in to comment.