Skip to content

Commit

Permalink
DataViews: rename operatorsFromField to sanitizeOperators (#57050)
Browse files Browse the repository at this point in the history
  • Loading branch information
oandregal authored and artemiomorales committed Jan 4, 2024
1 parent fa730e9 commit 094e668
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/dataviews/src/filters.js
Expand Up @@ -6,7 +6,7 @@ import AddFilter from './add-filter';
import ResetFilters from './reset-filters';
import { ENUMERATION_TYPE, OPERATOR_IN, OPERATOR_NOT_IN } from './constants';

const operatorsFromField = ( field ) => {
const sanitizeOperators = ( field ) => {
let operators = field.filterBy?.operators;
if ( ! operators || ! Array.isArray( operators ) ) {
operators = [ OPERATOR_IN, OPERATOR_NOT_IN ];
Expand All @@ -23,7 +23,7 @@ export default function Filters( { fields, view, onChangeView } ) {
return;
}

const operators = operatorsFromField( field );
const operators = sanitizeOperators( field );
if ( operators.length === 0 ) {
return;
}
Expand Down

0 comments on commit 094e668

Please sign in to comment.