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)