Skip to content
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]

### Changed

- Switch banners endpoint to use intsch as primary with intelligentSearchApi as fallback.

## [1.83.0] - 2025-10-06

### Changed
Expand Down
16 changes: 6 additions & 10 deletions node/services/banners.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { compareApiResults } from '../utils/compareResults'
import { buildAttributePath } from '../commons/compatibility-layer';
import { withFallback } from '../utils/with-fallback'
import { buildAttributePath } from '../commons/compatibility-layer'

export async function fetchBanners(
ctx: Context,
Expand All @@ -12,15 +12,11 @@ export async function fetchBanners(
path: buildAttributePath(args.selectedFacets),
}

return compareApiResults(
return withFallback(
() => intsch.fetchBanners(argumentsToFetchBanners),
() => intelligentSearchApi.fetchBanners(argumentsToFetchBanners),
() =>
intsch.fetchBanners(argumentsToFetchBanners),
ctx.vtex.production ? 10 : 100,
ctx.vtex.logger,
{
logPrefix: 'Banners',
args: argumentsToFetchBanners,
}
'Banners',
argumentsToFetchBanners
)
}
Loading