замечания 3

This commit is contained in:
2025-11-02 12:40:42 +03:00
parent 35493a09b5
commit 0d1dcf21c1
29 changed files with 1498 additions and 1827 deletions

View File

@@ -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) {