File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -51,14 +51,15 @@ export default class extends AdminForthPlugin {
5151
5252 const normalizeFilterValue = ( filters : any [ ] ) => {
5353 const filtersToReturn = [ ] ;
54- for ( const filter of filters ) {
55- if ( filter . field . startsWith ( '_universal_search_' ) ) {
54+ const normalizedFilters = Array . isArray ( filters ) ? filters : [ ] ;
55+ for ( const filter of normalizedFilters ) {
56+ if ( filter . field ?. startsWith ( '_universal_search_' ) ) {
5657 const searchTerm = filter . value as string ;
5758 if ( ! searchTerm ) continue ;
5859 const searchFieldName = filter . field . replace ( '_universal_search_' , '' ) ;
5960 const filterFromSearch = this . options . filters . find ( f => f . name === searchFieldName ) ?. searchInput ?.( searchTerm ) || { field : searchFieldName , operator : AdminForthFilterOperators . EQ , value : searchTerm } ;
6061 filtersToReturn . push ( filterFromSearch ) ;
61- } else if ( filter . field . startsWith ( '_qf_' ) ) {
62+ } else if ( filter . field ? .startsWith ( '_qf_' ) ) {
6263 const quickFilter = this . options . filters . find ( f => `_qf_${ f . name } ` === filter . field ) ;
6364 if ( quickFilter ?. enum ) {
6465 const enumOption = quickFilter . enum . find ( e => e . label === filter . value ) ;
You can’t perform that action at this time.
0 commit comments