diff --git a/src/services/pmsGrid/PmsHeaderOption.jsx b/src/services/pmsGrid/PmsHeaderOption.jsx index 66c8e694..6b2f5f21 100644 --- a/src/services/pmsGrid/PmsHeaderOption.jsx +++ b/src/services/pmsGrid/PmsHeaderOption.jsx @@ -6,7 +6,7 @@ const OPERATORS = { { key: "neq", label: "Not Equal" }, { key: "gt", label: "Greater Than" }, { key: "gte", label: "Greater or Equal" }, - { key: "less than", label: "Less Than" }, + { key: "lt", label: "Less Than" }, { key: "lte", label: "Less or Equal" }, { key: "between", label: "Between" }, ], @@ -25,24 +25,24 @@ const OPERATORS = { // ----------- FILTER UI COMPONENT ---------- function AdvanceFilter({ type = "number", onApply, onClear }) { - const [operator, setOperator] = useState(""); + const [operation, setOperator] = useState(""); const [value1, setValue1] = useState(""); const [value2, setValue2] = useState(""); const ops = OPERATORS[type]; - const apply = () => { - if (!operator) return; + const apply = () => { + if (!operation) return; - if (operator === "between") { + if (operation === "between") { onApply({ - operator, + operation, from: value1, to: value2, }); } else { onApply({ - operator, + operation, value: value1, }); } @@ -50,7 +50,7 @@ function AdvanceFilter({ type = "number", onApply, onClear }) { return (