Skip to content

Commit

Permalink
[frontend] fix list variables inside email content
Browse files Browse the repository at this point in the history
Signed-off-by: Marine LM <[email protected]>
  • Loading branch information
MarineLeM committed Oct 17, 2024
1 parent a2bfc78 commit 4997d53
Showing 1 changed file with 2 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -162,15 +162,9 @@ const UpdateInjectDetails = ({
&& data[field.key]
&& data[field.key].length > 0
) {
const regex = /&lt;#list\s+(\w+)\s+as\s+(\w+)&gt;/g;
finalData[field.key] = data[field.key]
.replaceAll(
'&lt;#list challenges as challenge&gt;',
'<#list challenges as challenge>',
)
.replaceAll(
'&lt;#list articles as article&gt;',
'<#list articles as article>',
)
.replace(regex, (_, listName, identifier) => `<#list ${listName} as ${identifier}>`)
.replaceAll('&lt;/#list&gt;', '</#list>');
} else if (data[field.key] && field.type === 'tuple') {
if (field.cardinality && field.cardinality === '1') {
Expand Down

0 comments on commit 4997d53

Please sign in to comment.