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