Skip to content

Commit

Permalink
Merge pull request #27199 from colemanw/fixSkTotals
Browse files Browse the repository at this point in the history
SearchKit - Fix broken totals row and query output
  • Loading branch information
colemanw authored Sep 3, 2023
2 parents 0f7ea0f + 7dc1a37 commit 6918fed
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -43,10 +43,12 @@

// Add callbacks for pre & post run
this.onPreRun.push(function(apiCalls) {
apiCalls.run.debug = true;
// So the raw SQL can be shown in the "Query Info" tab
apiCalls.run[2].debug = true;
});

this.onPostRun.push(function(apiResults) {
// Add debug output (e.g. raw SQL) to the "Query Info" tab
ctrl.debug = _.extend(_.pick(ctrl.debug, 'apiParams'), apiResults.run.debug);
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@
this.$onInit = function() {
var tallyParams;

// Copy API params from the run and adapt them in a secondary `tally` call for the "Totals" row
if (ctrl.settings.tally) {
ctrl.onPreRun.push(function (apiCalls) {
ctrl.tally = null;
tallyParams = _.cloneDeep(apiCalls.run);
tallyParams = _.cloneDeep(apiCalls.run[2]);
});

ctrl.onPostRun.push(function (apiResults, status) {
Expand Down

0 comments on commit 6918fed

Please sign in to comment.