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

fix: videos not being shown in productSearch query #474

Merged
merged 1 commit into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.

## [Unreleased]

### Fix
- `videos` in productSearch query


## [1.69.0] - 2024-03-21
- Parameter `groupBy` into `recommendations` and `productRecommendations` resolvers and `groupByProduct` in `crossSelling` search client.

Expand Down
16 changes: 10 additions & 6 deletions node/resolvers/search/sku.ts
Original file line number Diff line number Diff line change
Expand Up @@ -65,12 +65,16 @@ export const resolvers = {
return variations
},

videos: ({ Videos }: SearchItem) =>
map(
videos: ({ Videos, videos }: SearchItem) => {
let sanitizedVideo = Videos ? Videos : videos

const formattedVideo = sanitizedVideo.map(
(video: string) => ({
videoUrl: video,
}),
Videos
),
videoUrl: video
})
)

return formattedVideo
}
},
}
3 changes: 2 additions & 1 deletion node/typings/Catalog.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,7 @@ interface SearchItem {
modalType: any | null
images: SearchImage[]
Videos: string[]
videos: string[]
variations: string[]
sellers: Seller[]
attachments: {
Expand Down Expand Up @@ -220,7 +221,7 @@ interface CommertialOffer {
}[]
GetInfoErrorMessage: any | null
CacheVersionUsedToCallCheckout: string
// Supports the Intelligent Search API which
// Supports the Intelligent Search API which
// uses the same name from the simulation
discountHighlights: any[]
}
Expand Down
Loading