Skip to content

Commit ed135da

Browse files
Add log to detect categoryTree mount for non vtex accounts (#511)
* Added log info to product Categories To CategoryTree for non 'vtex' platform param * Added changelog
1 parent cd118f1 commit ed135da

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.
77

88
## [Unreleased]
99

10+
### Added
11+
12+
- Added log to `productCategoriesToCategoryTree` fallback return if the platform is not `vtex` to detect if it is used
13+
1014
## [1.88.0] - 2025-10-27
1115

1216
### Changed

node/resolvers/search/product.ts

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { compose, last, omit, pathOr, split, flatten } from 'ramda'
1+
import { compose, flatten, last, omit, pathOr, split } from 'ramda'
22

33
import {
44
addContextToTranslatableString,
@@ -123,7 +123,7 @@ const findMainTree = (categoriesIds: string[], prodCategoryId: string) => {
123123
const productCategoriesToCategoryTree = async (
124124
{ categories, categoriesIds, categoryId: prodCategoryId }: SearchProduct,
125125
_: any,
126-
{ clients: { search }, vtex: { platform } }: Context
126+
{ clients: { search }, vtex: { platform, logger } }: Context
127127
) => {
128128
if (!categories || !categoriesIds) {
129129
return []
@@ -134,6 +134,8 @@ const productCategoriesToCategoryTree = async (
134134
if (platform === 'vtex') {
135135
return mainTreeIds.map(categoryId => search.category(Number(categoryId)))
136136
}
137+
138+
logger.info({ message: 'productCategoriesToCategoryTree: not vtex platform', platform })
137139
const categoriesTree = await search.categories(mainTreeIds.length)
138140
const categoryMap = buildCategoryMap(categoriesTree)
139141
const mappedCategories = mainTreeIds

0 commit comments

Comments
 (0)