rewrite this javascript code, so that products of suggestions are given the amount of the the item before being assigned to treeItem.products:

treeItem.products = suggestions.find((item) => item.id === treeItem.id)?.products ?? [];