Showing
1 changed file
with
2 additions
and
3 deletions
@@ -94,12 +94,11 @@ exports.getSearchData = (params, channel) => { | @@ -94,12 +94,11 @@ exports.getSearchData = (params, channel) => { | ||
94 | 94 | ||
95 | let filters = Object.assign(searchHandler.handleFilterDataAll(result[2].data, params), | 95 | let filters = Object.assign(searchHandler.handleFilterDataAll(result[2].data, params), |
96 | finalResult.search.leftContent.sort); | 96 | finalResult.search.leftContent.sort); |
97 | - let termsSuggestion = _.get(result[2], 'data.suggestion.terms_suggestion', false); | 97 | + let termsSuggestion = _.get(result[2], 'data.suggestion.terms_suggestion', []); |
98 | 98 | ||
99 | filters.checkedConditions.conditions = _.concat(filters.checkedConditions.conditions, | 99 | filters.checkedConditions.conditions = _.concat(filters.checkedConditions.conditions, |
100 | finalResult.search.leftContent.checked); | 100 | finalResult.search.leftContent.checked); |
101 | 101 | ||
102 | - | ||
103 | Object.assign(finalResult.search, | 102 | Object.assign(finalResult.search, |
104 | searchHandler.handlePathNavData({total: result[2].data.total }, params, 'search', channel), | 103 | searchHandler.handlePathNavData({total: result[2].data.total }, params, 'search', channel), |
105 | { | 104 | { |
@@ -113,7 +112,7 @@ exports.getSearchData = (params, channel) => { | @@ -113,7 +112,7 @@ exports.getSearchData = (params, channel) => { | ||
113 | hasNextPage: searchHandler.handleNextPage(params, result[2].data.total), | 112 | hasNextPage: searchHandler.handleNextPage(params, result[2].data.total), |
114 | shopEntry: result[3], | 113 | shopEntry: result[3], |
115 | name: params.query, | 114 | name: params.query, |
116 | - suggest: termsSuggestion ? termsSuggestion.join(',').split(',').splice(0, 3) : false, | 115 | + suggest: ( termsSuggestion.length !== 0) ? termsSuggestion.join(',').split(',').splice(0, 3) : false, |
117 | changedQuery: result[2].data.isChangedQuery == 'Y', | 116 | changedQuery: result[2].data.isChangedQuery == 'Y', |
118 | suggestFirst: finalResult.search.suggestFirst, | 117 | suggestFirst: finalResult.search.suggestFirst, |
119 | suggestSecond: finalResult.search.suggestSecond | 118 | suggestSecond: finalResult.search.suggestSecond |
-
Please register or login to post a comment