Skip to content

Commit

Permalink
Fix Query not working when switching to $in with non-empty, non-array…
Browse files Browse the repository at this point in the history
… value

reorder if statements to always set value to [] when switching to $in

Workflow of Problem occurring in sample app:
-Open Query Builder via Eigene Abfrage Erstellen
-Select Countries as Source Store
-Set Query to Name $eq Afghanistan
-Set Operator to $in
-Start Querying
-Get Error operator '$in' expects an array as value type but got '"Afghanistan"'
-Clear Value Afghanistan via X
-Set Value to Afghanistan
-Start Querying
-Get correct Result
  • Loading branch information
LRadigkConTerra committed Dec 20, 2023
1 parent 7f1303a commit 882f156
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/main/js/bundles/dn_querybuilder/FieldWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -391,11 +391,11 @@
},
relationalOperatorChanged: function (relationalOperator, fieldQuery) {
const selectedField = this.selectedField;
if (fieldQuery.value === null || fieldQuery.value === "") { /* only if no value was selected*/
if (relationalOperator === "$in") {
fieldQuery.value = [];
} else if (fieldQuery.value === null || fieldQuery.value === "") { /* only if no value was selected*/
if (relationalOperator === "$exists") {
fieldQuery.value = true;
} else if (relationalOperator === "$in") {
fieldQuery.value = [];
} else {
if (selectedField.type === "date") {
fieldQuery.value = "";
Expand Down

0 comments on commit 882f156

Please sign in to comment.