Skip to content

Commit 4a49175

Browse files
Added log info to product Categories To CategoryTree for non 'vtex' platform param
1 parent 75de010 commit 4a49175

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines 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)