Skip to content

Commit 2042ae0

Browse files
committed
Tweaked logic in getFilter() in ServiceRequest to remove "=" from ">" and "<" operations if the parameters came from a JSON payload
1 parent e7a48aa commit 2042ae0

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

src/javaxt/express/ServiceRequest.java

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -912,7 +912,12 @@ public Filter getFilter(){
912912
}
913913

914914
else if (a.equals(">") || b.equals(">")){
915-
op = ">=";
915+
916+
op = ">="; //add "=" (legacy: assumes params are from url)
917+
if (parseJson && json!=null){
918+
if (json.has(key)) op = ">";
919+
}
920+
916921
if (b.equals(">")){
917922
val = val.substring(1).trim();
918923
}
@@ -922,7 +927,12 @@ else if (a.equals(">") || b.equals(">")){
922927
}
923928

924929
else if (a.equals("<") || b.equals("<")){
925-
op = "<=";
930+
931+
op = "<="; //add "=" (legacy: assumes params are from url)
932+
if (parseJson && json!=null){
933+
if (json.has(key)) op = "<";
934+
}
935+
926936
if (b.equals("<")){
927937
val = val.substring(1).trim();
928938
}
@@ -1285,7 +1295,7 @@ public void remove(String col){
12851295
items.remove(key);
12861296
}
12871297

1288-
1298+
12891299
/** Used to remove all the items from the filter
12901300
*/
12911301
public void removeAll(){

0 commit comments

Comments
 (0)