Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the ✨ Finishing touches🧪 Generate unit tests (beta)
Comment |
| ): Promise<{ imageUrl: string | null; productUrl: string | null }> => { | ||
| const affiliateTag = process.env.NEXT_PUBLIC_AMAZON_AFFILIATE_TAG; | ||
| const encodedSearch = encodeURIComponent(title).replace(/%20/g, '+'); | ||
| const productUrl = `https://www.amazon.com/s?k=${encodedSearch}${affiliateTag ? `&tag=${affiliateTag}` : ''}`; |
There was a problem hiding this comment.
title is just the name of a gift to be searched. This just uses title as if it's a product id with the goal of creating an Amazon product page. But by using /s?k= it just creates a search page instead.
| const affiliateTag = process.env.NEXT_PUBLIC_AMAZON_AFFILIATE_TAG; | ||
| const encodedSearch = encodeURIComponent(title).replace(/%20/g, '+'); | ||
| const productUrl = `https://www.amazon.com/s?k=${encodedSearch}${affiliateTag ? `&tag=${affiliateTag}` : ''}`; | ||
| return { imageUrl: null, productUrl }; |
There was a problem hiding this comment.
imageUrl will always be null here.
Description
Before:
Describe previous behavior
After:
Describe new behavior, including what was changed and why
Closes #[ticketnumber]
Testing instructions
If applicable, provide steps for reviewers to test changes locally -- including necessary setup, commands, and expected results
Additional information
Share any additional info that may provide context for the PR evaluation (performance considerations, design choices, etc)
[optional] Screenshots
Pre-submission checklist
test #001: created unit test for __ component)Peer Code ReviewersandSenior+ Code Reviewersgroupsgis-code-questions