Skip to content

Commit

Permalink
Merge pull request #474 from vtex-apps/fix/videos
Browse files Browse the repository at this point in the history
fix: videos not being shown in productSearch query
  • Loading branch information
iago1501 authored Jun 10, 2024
2 parents dd7768c + facdd3d commit 5b0c808
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 7 deletions.
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

0 comments on commit 5b0c808

Please sign in to comment.