From b378213bc6b6368ee2932f8ebe043d14ca6f2777 Mon Sep 17 00:00:00 2001 From: Ebubeker Date: Mon, 8 Jan 2024 17:43:09 +0100 Subject: [PATCH] fix: build error --- apps/web/components/map/panels/filter/Filter.tsx | 3 ++- apps/web/lib/utils/filtering/filtering_cql.ts | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/apps/web/components/map/panels/filter/Filter.tsx b/apps/web/components/map/panels/filter/Filter.tsx index 7d1097a0..48cdff8e 100644 --- a/apps/web/components/map/panels/filter/Filter.tsx +++ b/apps/web/components/map/panels/filter/Filter.tsx @@ -112,7 +112,7 @@ const FilterPanel = (props: FilterProps) => { ); setExpressions(existingExpressions); } else { - const query = createTheCQLBasedOnExpression(expressions, logicalOperator, layerAttributes); + const query = createTheCQLBasedOnExpression(expressions, layerAttributes, logicalOperator); setLogicalOperator("op" in query ? (query.op as "and" | "or") : "and"); const updatedProjectLayer = { @@ -129,6 +129,7 @@ const FilterPanel = (props: FilterProps) => { setTimeout(() => { mutate(); }, 300); + // eslint-disable-next-line react-hooks/exhaustive-deps }, [expressions, logicalOperator]); return ( diff --git a/apps/web/lib/utils/filtering/filtering_cql.ts b/apps/web/lib/utils/filtering/filtering_cql.ts index 75b41c22..e14c34c4 100644 --- a/apps/web/lib/utils/filtering/filtering_cql.ts +++ b/apps/web/lib/utils/filtering/filtering_cql.ts @@ -133,8 +133,8 @@ export function or_operator(args: string[]) { export function createTheCQLBasedOnExpression( expressions, + layerAttributes: {keys: {name: string, type: string}[]}, logicalOperator?: "and" | "or", - layerAttributes: {keys: {name: string, label}[]}, ) { const queries = expressions .filter((exp) => exp.value && exp.expression && exp.attribute)