eager-cartoon-14662
08/07/2023, 8:25 AMacceptable-kangaroo-64719
08/07/2023, 11:19 AMfresh-fireman-491
08/07/2023, 11:25 AMacceptable-kangaroo-64719
08/07/2023, 11:26 AMfresh-fireman-491
08/07/2023, 11:35 AMacceptable-kangaroo-64719
08/07/2023, 11:38 AMfresh-fireman-491
08/07/2023, 11:39 AMacceptable-kangaroo-64719
08/07/2023, 11:40 AMeager-cartoon-14662
08/07/2023, 1:38 PMeager-cartoon-14662
08/07/2023, 1:39 PMacceptable-kangaroo-64719
08/08/2023, 10:24 AMjs
workflow.recipes = []
const myCards = workflow.recipeInfo.map((recipe) => {
workflow.recipes.push({
title: recipe.title,
vegetarian: recipe.vegetarian,
vegan: recipe.vegan,
glutenFree: recipe.glutenFree,
dairyFree: recipe.dairyFree,
veryHealthy: recipe.veryHealthy,
cheap: recipe.cheap,
veryPopular: recipe.veryPopular,
readyInMinutes: recipe.readyInMinutes,
servings: recipe.servings,
summary: recipe.summary
})
// create the card object
return {
type: 'card',
title: {
dynamicValue: `${recipe.title}`,
valueType: 'dynamic'
},
subtitle: {
dynamicValue: '',
valueType: 'dynamic'
},
imageUrl: {
dynamicValue: `${recipe.image}`,
valueType: 'dynamic'
},
actions: [
{
action: 'url',
label: 'View Recipe',
value: `${recipe.sourceUrl}`
}
]
}
})
workflow.cards = []
for (var card of myCards) {
workflow.cards.push({
//in order to render a card, we only need these three fields
title: card.title,
imageUrl: card.imageUrl,
actions: card.actions[0]
})
}
acceptable-kangaroo-64719
08/08/2023, 1:17 PMgentle-ability-75784
08/09/2023, 3:20 AMeager-cartoon-14662
08/09/2023, 6:21 AM