Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Related Products loader :: remove throw new error and add unavailable items #102

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

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.

@@ -85,7 +85,8 @@ async function loader(
const productId = await getProductGroupID(props);

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