Skip to content

Commit

Permalink
Update product-promotion-component-controller.js
Browse files Browse the repository at this point in the history
  • Loading branch information
qiyundai committed Jun 7, 2024
1 parent d54dd27 commit 43e5a96
Showing 1 changed file with 7 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@ export function onSubmit(component, props) {

const selectedProducts = productGroup?.getSelectedProducts();

const relatedProducts = selectedProducts.map((p) => ({
name: p.title,
url: p.url,
}));
if (selectedProducts) {
const relatedProducts = selectedProducts.map((p) => ({
name: p.title,
url: p.url,
}));

props.payload = { ...props.payload, relatedProducts };
props.payload = { ...props.payload, relatedProducts };
}
}

export default async function init(component, props) {
Expand Down

0 comments on commit 43e5a96

Please sign in to comment.