File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
src/collections/infra/repositories Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -357,10 +357,13 @@ export class CollectionsRepository extends ApiRepository implements ICollections
357357
358358 if ( collectionSearchCriteria ?. filterQueries ) {
359359 collectionSearchCriteria . filterQueries . forEach ( ( filterQuery ) => {
360- const [ filterQueryKey , filterQueryValue ] = filterQuery . split ( ':' )
360+ const idx = filterQuery . indexOf ( ':' )
361+ if ( idx === - 1 ) return // Invalid filter query, skip it
361362
362- const filterQueryValueWithQuotes = `"${ filterQueryValue } "`
363+ const filterQueryKey = filterQuery . substring ( 0 , idx ) . trim ( )
364+ const filterQueryValue = filterQuery . substring ( idx + 1 ) . trim ( )
363365
366+ const filterQueryValueWithQuotes = `"${ filterQueryValue } "`
364367 const filterQueryToSet = `${ filterQueryKey } :${ filterQueryValueWithQuotes } `
365368
366369 queryParams . append ( GetCollectionItemsQueryParams . FILTERQUERY , filterQueryToSet )
You can’t perform that action at this time.
0 commit comments