From 9ebd890c04902dcb2d810c307e46cef004ef8980 Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Wed, 23 Oct 2024 15:13:58 +0100 Subject: [PATCH] Handle empty arrays too. --- packages/shared-core/src/utils.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/packages/shared-core/src/utils.ts b/packages/shared-core/src/utils.ts index 8e22c10c15..01afbc2539 100644 --- a/packages/shared-core/src/utils.ts +++ b/packages/shared-core/src/utils.ts @@ -135,17 +135,19 @@ export function isSupportedUserSearch(query: SearchFilters) { return false } } + return true } export function processSearchFilters(filterArray: undefined): undefined +export function processSearchFilters(filterArray: []): undefined export function processSearchFilters( filterArray: LegacyFilter[] ): Required export function processSearchFilters( filterArray?: LegacyFilter[] ): Required | undefined { - if (!filterArray) { + if (!filterArray || filterArray.length === 0) { return undefined } const { allOr, onEmptyFilter, filters } = splitFiltersArray(filterArray)