Skip to content

Commit

Permalink
Merge pull request #4462 from obiba/bugfix/query-update
Browse files Browse the repository at this point in the history
Make sure to update from correct target
  • Loading branch information
ymarcon authored Oct 10, 2024
2 parents 66e3016 + 3f3bffe commit a6a86f7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions mica-webapp/src/main/webapp/assets/js/mica-query.js
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ class EntityQuery {
theTree.addQuery(null, targetQuery);
}

let query = this.__findQuery(theTree, updateQuery);
let query = this.__findQuery(theTree.asTree(targetQuery), updateQuery);

if (!query) {
theTree.addQuery(targetQuery, updateQuery);
Expand Down Expand Up @@ -280,10 +280,11 @@ class EntityQuery {
// create target and add query as child, done!
targetQuery = new RQL.Query(info.target);
theTree.addQuery(null, targetQuery);
theTree.addQuery(targetQuery, info.query)
theTree.addQuery(targetQuery, info.query);
alertEventData = {target: info.target, query: info.query, action: 'created'};
} else {
let theQuery = this.__findQuery(theTree, info.query);
// Update from the parent targetQuery
let theQuery = this.__findQuery(theTree.asTree(targetQuery), info.query);
if (theQuery) {
// query exists, just update
theQuery.name = info.newName || info.query.name;
Expand Down

0 comments on commit a6a86f7

Please sign in to comment.