Skip to content

Commit

Permalink
fix(slack): add support of blank space in handlebar (#2959)
Browse files Browse the repository at this point in the history
* fix(slack): add supprot of blank space in handlber

* chore: added test cases description

* update test case description

---------

Co-authored-by: Anant Jain <[email protected]>
  • Loading branch information
ItsSudip and anantjain45823 authored Jan 17, 2024
1 parent 38c6e60 commit ff12d8f
Show file tree
Hide file tree
Showing 2 changed files with 2,021 additions and 1,983 deletions.
4 changes: 2 additions & 2 deletions src/v0/destinations/slack/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -80,12 +80,12 @@ const buildDefaultTraitTemplate = (traitsList, traits, template) => {
let generatedStringFromTemplate = template;
// build template with whitelisted traits
traitsList.forEach((trait) => {
generatedStringFromTemplate += `${trait}: {{${trait}}} `;
generatedStringFromTemplate += `${trait}: {{"${trait}"}} `;
});
// else with all traits
if (traitsList.length === 0) {
Object.keys(traits).forEach((traitKey) => {
generatedStringFromTemplate += `${traitKey}: {{${traitKey}}} `;
generatedStringFromTemplate += `${traitKey}: {{"${traitKey}"}} `;
});
}
return generatedStringFromTemplate;
Expand Down
Loading

0 comments on commit ff12d8f

Please sign in to comment.