замечания 3
This commit is contained in:
@@ -127,14 +127,8 @@ router.get('/', verifyToken, async (req, res) => {
|
||||
log('[Search] Industry codes:', industryList, 'Mapped to:', dbIndustries);
|
||||
|
||||
if (dbIndustries.length > 0) {
|
||||
// Handle both string and array industry values
|
||||
filters.push({
|
||||
$or: [
|
||||
{ industry: { $in: dbIndustries } },
|
||||
{ industry: { $elemMatch: { $in: dbIndustries } } }
|
||||
]
|
||||
});
|
||||
log('[Search] Added industry filter:', { $or: [{ industry: { $in: dbIndustries } }, { industry: { $elemMatch: { $in: dbIndustries } } }] });
|
||||
filters.push({ industry: { $in: dbIndustries } });
|
||||
log('[Search] Added industry filter:', { industry: { $in: dbIndustries } });
|
||||
} else {
|
||||
log('[Search] No industries mapped! Codes were:', industryList);
|
||||
}
|
||||
@@ -219,10 +213,8 @@ router.get('/', verifyToken, async (req, res) => {
|
||||
page: pageNum,
|
||||
totalPages: Math.ceil(total / limitNum),
|
||||
_debug: {
|
||||
requestParams: { query, industries, companySize, geography, minRating, hasReviews, hasAcceptedDocs, sortBy, sortOrder },
|
||||
filter: JSON.stringify(filter),
|
||||
filtersCount: filters.length,
|
||||
appliedFilters: filters.map(f => JSON.stringify(f))
|
||||
industriesReceived: industries
|
||||
}
|
||||
});
|
||||
} catch (error) {
|
||||
|
||||
Reference in New Issue
Block a user