Files
medusa-store/packages
patpich ff37cd190f fix(search): add missing default product relations (#4008)
* fix(search): add missing default product relations

Add missing default product relations for events calling SearchService.addDocuments

For the following events: `ProductService.Events.UPDATED,  ProductVariantService.Events.CREATED, ProductVariantService.Events.UPDATED]`,
`SearchService.addDocuments` will fail due to `product` missing its `variants` relations.

The issue can be observed with the Algolia plugin where `reduce` is being attempted on `product.variants`.
https://github.com/medusajs/medusa/blob/develop/packages/medusa-plugin-algolia/src/utils/transformer.ts#L14

Implement the same retrieve pattern as `handleProductCreation` method.

* chore(changeset): patch

---------

Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
2023-05-05 13:04:56 +02:00
..
2023-05-04 10:51:13 +02:00
2023-05-04 10:51:13 +02:00
2023-04-04 18:35:27 +02:00
2023-04-04 18:35:27 +02:00
2023-04-04 18:35:27 +02:00
2023-04-04 18:35:27 +02:00
2023-04-04 18:35:27 +02:00
2023-05-04 10:51:13 +02:00
2023-04-04 18:35:27 +02:00
2023-05-04 10:51:13 +02:00
2023-05-04 10:51:13 +02:00