Skip to content

Commit

Permalink
Merge pull request #285 from weni-ai/fix/wpp-localization-without-list
Browse files Browse the repository at this point in the history
fix: handle undefined list_items in localizations
  • Loading branch information
paulobernardoaf authored Nov 28, 2024
2 parents c12dfe6 + abb4532 commit eaf4168
Showing 1 changed file with 9 additions and 7 deletions.
16 changes: 9 additions & 7 deletions src/components/flow/actions/localization/helpers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,15 @@ export const initializeWhatsappMsgLocalizedForm = (
buttonText: { value: '' },
actionURL: { value: '' },
listItems: {
value: (originalAction as SendWhatsAppMsg).list_items.map(item => {
return {
uuid: item.uuid,
title: '',
description: '',
};
}),
value: ((originalAction as SendWhatsAppMsg).list_items || []).map(
item => {
return {
uuid: item.uuid,
title: '',
description: '',
};
},
),
},
listItemTitleEntry: { value: '' },
listItemDescriptionEntry: { value: '' },
Expand Down

0 comments on commit eaf4168

Please sign in to comment.