Skip to content

fix: resolve targetTags reference in related products#545

Open
hashhhh-16 wants to merge 2 commits into
niharika-mente:mainfrom
hashhhh-16:fix/related-products-target-tags
Open

fix: resolve targetTags reference in related products#545
hashhhh-16 wants to merge 2 commits into
niharika-mente:mainfrom
hashhhh-16:fix/related-products-target-tags

Conversation

@hashhhh-16

Copy link
Copy Markdown
Contributor

Summary

Fixes a bug in the related products endpoint where tag matching incorrectly referenced targetTags instead of targetTagsSet.

Changes Made

  • Replaced targetTags.has(tag.toLowerCase()) with targetTagsSet.has(tag.toLowerCase()) in getRelatedProducts.
  • Ensures related products are scored correctly based on matching tags.
  • Prevents runtime issues caused by referencing an undefined variable.

Testing

  • Verified the related products logic uses the correct tag set for matching.
  • Confirmed the application builds and lint checks pass after the fix.

Issue

Closes #502

@vercel

vercel Bot commented Jun 28, 2026

Copy link
Copy Markdown

Someone is attempting to deploy a commit to the niharika-mente's projects Team on Vercel.

A member of the Team first needs to authorize it.

Aamod007
Aamod007 previously approved these changes Jul 2, 2026

@Aamod007 Aamod007 left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

@Aamod007 Aamod007 self-requested a review July 2, 2026 17:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Backend: ReferenceError 'targetTags' is not defined in getRelatedProducts endpoint

2 participants