Skip to content

Commit

Permalink
Merge branch 'develop' of github.com:erxes/erxes into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
munkhorgil committed Jan 7, 2021
2 parents 8119243 + 416bbb5 commit 8d48a78
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion dashboard-api/controller/controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,19 @@ const generateReport = async (req, res) => {

const { dashboardToken } = query;

let resultSet = {};

const dashboardQuery = JSON.parse(query.dashboardQuery);

const cubejsApi = cubejs.default(dashboardToken, {
apiUrl: `${CUBEJS_URL}/cubejs-api/v1`
});

const resultSet = await cubejsApi.load(dashboardQuery);
try {
resultSet = await cubejsApi.load(dashboardQuery);
} catch (e) {
console.log(e);
}

if (resultSet.loadResponse.query.dimensions[0]) {
const dimensions = resultSet.loadResponse.query.dimensions[0];
Expand Down

0 comments on commit 8d48a78

Please sign in to comment.