@isoftdata/utility-dashboard-backend 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/index.js +18 -13
  2. package/package.json +3 -3
package/index.js CHANGED
@@ -149,19 +149,24 @@ const parameterizeQuery = (query, parameterValues) => {
149
149
 
150
150
  module.exports = {
151
151
  formatReportMetadata: async(mysqlConnection, { report, chartsInReport }) => {
152
- const parameterValues = await loadOutputParameterValues(mysqlConnection, report.parameters)
153
- const parameterValuesForClient = parameterValues.map(param => {
154
- const { queryValues, ...parameterValuesForClient } = param
155
- return parameterValuesForClient
156
- })
152
+ try {
153
+ const parameterValues = await loadOutputParameterValues(mysqlConnection, report.parameters)
154
+ const parameterValuesForClient = parameterValues.map(param => {
155
+ const { queryValues, ...parameterValuesForClient } = param
156
+ return parameterValuesForClient
157
+ })
157
158
 
158
- return {
159
- dashboardReportId: report.dashboardReportId,
160
- name: report.reportName,
161
- title: report.reportTitle,
162
- charts: chartsInReport,
163
- parameterValues: parameterValuesForClient,
164
- ownerId: report.ownerId,
159
+ return {
160
+ dashboardReportId: report.dashboardReportId,
161
+ name: report.reportName,
162
+ title: report.reportTitle,
163
+ charts: chartsInReport,
164
+ parameterValues: parameterValuesForClient,
165
+ ownerId: report.ownerId,
166
+ }
167
+ } catch (err) {
168
+ console.error(err)
169
+ throw err
165
170
  }
166
171
  },
167
172
  formatChartDataForReport: async(mysqlConnection, { reportParameters, chart, reportChart, parameterSelectionList }) => {
@@ -175,7 +180,7 @@ module.exports = {
175
180
  })
176
181
  } catch (err) {
177
182
  console.error(err)
178
- return { isErrored: true, err }
183
+ throw err
179
184
  }
180
185
  },
181
186
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@isoftdata/utility-dashboard-backend",
3
- "version": "1.0.0",
3
+ "version": "1.0.1",
4
4
  "description": "A utility for formatting chart and report data to be usable by the frontend dashboard component.",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -12,8 +12,8 @@
12
12
  "@isoftdata/utility-date-time": "^2.0.3",
13
13
  "@isoftdata/utility-db": "^2.2.0",
14
14
  "date-fns": "^2.23.0",
15
- "klona": "^2.0.4",
15
+ "klona": "^1.1.2",
16
16
  "mysql": "^2.18.1",
17
17
  "to-snake-case": "^1.0.0"
18
18
  }
19
- }
19
+ }