mirror of
https://github.com/christianvidalwolf-prog/CrazeAnalytix.git
synced 2026-08-03 13:05:24 +02:00
Implement multi-ASIN/SKU search support in all main views
This commit is contained in:
@@ -260,12 +260,19 @@ const AdsPerformance: React.FC<AdsPerformanceProps> = ({
|
||||
}
|
||||
|
||||
if (searchTerm) {
|
||||
const lowSearch = searchTerm.toLowerCase();
|
||||
result = result.filter(item =>
|
||||
item.asin.toLowerCase().includes(lowSearch) ||
|
||||
item.sku.toLowerCase().includes(lowSearch) ||
|
||||
item.title.toLowerCase().includes(lowSearch)
|
||||
);
|
||||
const searchTerms = searchTerm.toLowerCase().split(/[\s,]+/).filter(term => term.length > 0);
|
||||
if (searchTerms.length > 0) {
|
||||
result = result.filter(item => {
|
||||
const rowValues = [
|
||||
item.asin.toLowerCase(),
|
||||
item.sku.toLowerCase(),
|
||||
item.title.toLowerCase()
|
||||
];
|
||||
return searchTerms.some(term =>
|
||||
rowValues.some(val => val.includes(term))
|
||||
);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
// Apply WOC Filter
|
||||
|
||||
Reference in New Issue
Block a user