fix: fix cloudwatch metricFindQuery error that stopped it working completely, fixes #9876

This commit is contained in:
Torkel Ödegaard 2017-11-16 13:02:31 +01:00
parent 5b674ce29c
commit 119f5427af
2 changed files with 4 additions and 4 deletions

View File

@ -333,7 +333,7 @@ function (angular, _, moment, dateMath, kbn, templatingVariable) {
};
return backendSrv.datasourceRequest(options).then(function(result) {
return result;
return result.data;
});
};

View File

@ -68,7 +68,7 @@ describe('CloudWatchDatasource', function() {
beforeEach(function() {
ctx.backendSrv.datasourceRequest = function(params) {
requestParams = params.data;
return ctx.$q.when(response);
return ctx.$q.when({data: response});
};
});
@ -213,7 +213,7 @@ describe('CloudWatchDatasource', function() {
beforeEach(function() {
ctx.backendSrv.datasourceRequest = function(params) {
requestParams = params.data;
return ctx.$q.when(response);
return ctx.$q.when({data: response});
};
});
@ -235,7 +235,7 @@ describe('CloudWatchDatasource', function() {
setupCallback();
ctx.backendSrv.datasourceRequest = args => {
scenario.request = args.data;
return ctx.$q.when(scenario.requestResponse);
return ctx.$q.when({data: scenario.requestResponse});
};
ctx.ds.metricFindQuery(query).then(args => {
scenario.result = args;