mirror of
https://github.com/christianvidalwolf-prog/Craze-Data-check.git
synced 2026-08-03 14:05:25 +02:00
fix: restore CPNP No. from Supabase and simplify column filter matching in Cosmetic Items
Co-Authored-By: claude-flow <ruv@ruv.net>
This commit is contained in:
co-authored by
claude-flow
parent
60224931bc
commit
889e98b0ca
@@ -82,13 +82,10 @@ export function CosmeticItemsView({ data, headers, onSaveRow, onCaptureState, ro
|
||||
(Object.entries(columnFilters) as [string, string[]][]).forEach(([colIdx, filterValues]) => {
|
||||
if (!filterValues || filterValues.length === 0) return;
|
||||
const colNum = parseInt(colIdx);
|
||||
const allVals = getUniqueValues(colNum);
|
||||
// If all known values selected, no filtering needed
|
||||
const filterSet = new Set(filterValues);
|
||||
if (filterSet.size >= allVals.length && allVals.every(v => filterSet.has(v))) return;
|
||||
const filterSet = new Set(filterValues.map(f => f.trim()));
|
||||
result = result.filter(({ row }) => {
|
||||
const val = String(row[colNum] ?? '').trim();
|
||||
return filterValues.some(f => f.trim() === val);
|
||||
return filterSet.has(val);
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user