Closed MarNeumann closed 11 months ago
Thank you @MarNeumann for submitting these issues. I've ran through the entire recipe again and fixed all code snippet errors in PR #5897 . You can either refer to the PR for the fix or find it on the main docs once the PR is merged.
Hi @shahednasser,
First of all, thank you so much for your continued assistance! I updated my implementation.
However, it seems that the retrieveMediasByVariant
function is still missing from the documentation.
Additionally, just to ensure correctness, I noticed that the isPending
property is not defined in the MutationObserver[...]Result
interfaces. For now, I've stuck with using isLoading
.
Your help is greatly appreciated! 🌌
Regarding retrieveMediasByVariant
, I seem to forgot to add it to the PR 😅 just opened the PR #5899 to add it.
As for isPending
, which version of @tanstack/react-query
are you using? Because if you install the latest, it's isPending
. However, if you're using v4, it's isLoading
. I've added a note about it in the same PR.
Haha, now that's what i am talking about! Thank you so much.
Preliminary Checks
Issue Summary
Issue Description: After resolving the previous TypeScript error related to 'product_medias', I encountered a runtime error in the
handleOrderPlaced
function, as outlined in the MedusaJS digital product delivery recipe (https://docs.medusajs.com/recipes/digital-products#deliver-digital-products-to-the-customer). The error occurs when an order is placed, and thehandleOrderPlaced
function is triggered.Error Message: The error logged is:
An error occurred while processing order.placed: EntityPropertyNotFoundError: Property "product_medias" was not found in "ProductVariant". Make sure your query is correct.
Steps to Reproduce:
handleOrderPlaced
function based on the MedusaJS digital products recipe.handleOrderPlaced
function.Expected Behavior: The
handleOrderPlaced
function should successfully access the 'product_medias' field from the 'ProductVariant' entity and process the order without errors.Actual Behavior: Upon order placement, the function fails with an
EntityPropertyNotFoundError
, indicating that the 'product_medias' field does not exist in the 'ProductVariant' entity, despite attempts to extend the entity.Investigation Findings: It appears that the extension of the
ProductVariant
entity to include the 'product_medias' field did not correctly modify the underlying database schema, (particularly the 'product_variant' table?).Possible Solutions or Suggestions:
ProductVariant
entity in MedusaJS to include new fields and ensure these changes are reflected in the database schema.Environment:
Are you interested in working on this issue?