Fix power search for slogs

Reviewed By: antonk52

Differential Revision: D51232391

fbshipit-source-id: 6501f60ee4168c62d1d4efefcfcc698d4954e7ac
This commit is contained in:
Andrey Goncharov
2023-11-14 06:28:11 -08:00
committed by Facebook GitHub Bot
parent f6445fea43
commit 9910807826

View File

@@ -518,9 +518,6 @@ export function computeDataTableFilter(
const value = searchTerm.field.useWholeRow const value = searchTerm.field.useWholeRow
? item ? item
: getValueAtPath(item, searchTerm.field.key); : getValueAtPath(item, searchTerm.field.key);
if (!value) {
return treatUndefinedValuesAsMatchingFiltering;
}
const processor = const processor =
powerSearchProcessors[ powerSearchProcessors[
@@ -535,7 +532,21 @@ export function computeDataTableFilter(
return true; return true;
} }
return processor(searchTerm.operator, searchTerm.searchValue, value); try {
const res = processor(
searchTerm.operator,
searchTerm.searchValue,
value,
);
if (!res && !value) {
return treatUndefinedValuesAsMatchingFiltering;
}
return res;
} catch {
return treatUndefinedValuesAsMatchingFiltering;
}
}); });
}; };
} }