From 1e85981a17a8e715e948308d3e85072d976907d3 Mon Sep 17 00:00:00 2001 From: Shaheer Kochai Date: Tue, 11 Mar 2025 13:33:26 +0430 Subject: [PATCH] fix: display same key with multiple data types in filter suggestions by enhancing the deduping logic (#7255) * fix: display same key with multiple data types in filter suggestions by enhancing the deduping logic * refactor: remove unnecessary .trim() --- frontend/src/hooks/queryBuilder/useOptions.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frontend/src/hooks/queryBuilder/useOptions.ts b/frontend/src/hooks/queryBuilder/useOptions.ts index e990f789de..7f50f1881b 100644 --- a/frontend/src/hooks/queryBuilder/useOptions.ts +++ b/frontend/src/hooks/queryBuilder/useOptions.ts @@ -170,7 +170,11 @@ export const useOptions = ( (option, index, self) => index === self.findIndex( - (o) => o.label === option.label && o.value === option.value, // to remove duplicate & empty options from list + (o) => + // to remove duplicate & empty options from list + o.label === option.label && + o.value === option.value && + o.dataType?.toLowerCase() === option.dataType?.toLowerCase(), // handle case sensitivity ) && option.value !== '', ) || [] ).map((option) => {