Skip to content

Conversation

@Steffany-Martins
Copy link

@Steffany-Martins Steffany-Martins commented May 31, 2023

Problem:
When utilizing the loader ''vtexLegacyRelatedProductsLoader.ts'', the program currently returns the error message "Missing props. Please fill: slug or id." if the product ID does not exist.

Proposed Fixes:

  • Modify the loader to handle cases where the product ID is null and provide appropriate handling for such scenarios..
  • These fixes aim to improve the behavior of the program by addressing the issue of missing product IDs and enhancing the loader's ability to handle unavailable products.


if (!productId) {
throw new Error("Missing props. Please fill: slug or id");
// throw new Error("Missing props. Please fill: slug or id");
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
// throw new Error("Missing props. Please fill: slug or id");

Copy link
Contributor

@igorbrasileiro igorbrasileiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for contributing!
Remove the commented code that I pointed above, and it will be OK.

@igorbrasileiro
Copy link
Contributor

@tlgimenes take a look here.

@Steffany-Martins
Copy link
Author

@tlgimenes guys, can realease this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants