| @@ -18,28 +18,8 @@ | ||
| 18 | 18 | }; |
| 19 | 19 | |
| 20 | 20 | const validSlots = Object.keys(stores); |
| 21 | 21 | |
| 22 | -export const getRecommendation = ({ product, slot = 'plugin-search' }) => { | |
| 23 | - const state = stores[slot].getState(); | |
| 24 | - const recommendations = selectAllRecommendations(state).map( | |
| 25 | - (recommendation) => | |
| 26 | - objectFromKeys(recommendation, [ | |
| 27 | - 'slug', | |
| 28 | - 'title', | |
| 29 | - 'description', | |
| 30 | - 'ctaContent', | |
| 31 | - 'ctaType', | |
| 32 | - 'triggerContent', | |
| 33 | - 'triggerType', | |
| 34 | - ]), | |
| 35 | - ); | |
| 36 | - | |
| 37 | - return recommendations.find( | |
| 38 | - (recommendation) => recommendation.slug === product, | |
| 39 | - )?.slug; | |
| 40 | -}; | |
| 41 | - | |
| 42 | 22 | export const recordActivity = ({ slot, event, product }) => { |
| 43 | 23 | if (!event || !validSlots.includes(slot)) { |
| 44 | 24 | return; |
| 45 | 25 | } |