@things-factory/dataset 6.0.92 → 6.0.93

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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/dataset",
3
- "version": "6.0.92",
3
+ "version": "6.0.93",
4
4
  "main": "dist-server/index.js",
5
5
  "browser": "dist-client/index.js",
6
6
  "things-factory": true,
@@ -50,5 +50,5 @@
50
50
  "simple-statistics": "^7.8.3",
51
51
  "statistics": "^3.3.0"
52
52
  },
53
- "gitHead": "6b20d32f29809cd6c99fd22296f809816a6c954d"
53
+ "gitHead": "7a17b2f5659c3e162d7f73b47a04f5caafb566e2"
54
54
  }
@@ -150,7 +150,7 @@ export async function queryDataSummaryByPeriod(
150
150
  period == 'today'
151
151
  ? 'summary.date, summary.period'
152
152
  : ['this year', '12 months'].includes(period)
153
- ? 'month'
153
+ ? 'SUBSTRING(summary.date, 1, 7)'
154
154
  : 'summary.date'
155
155
  const groupByKeys = dataKeyItems
156
156
  .map((item, index) => {
@@ -179,11 +179,9 @@ export async function queryDataSummaryByPeriod(
179
179
  params,
180
180
  domain,
181
181
  alias: 'summary',
182
- searchables: ['name', 'description'].concat(searchables)
182
+ searchables: searchables
183
183
  })
184
184
  .select('summary.dataSet')
185
- .addSelect('ds.name', 'name')
186
- .addSelect('ds.description', 'description')
187
185
  .addSelect(selectData)
188
186
  .addSelect('SUM(summary.count)', 'count')
189
187
  .addSelect('SUM(summary.countOoc)', 'countOoc')
@@ -197,8 +195,6 @@ export async function queryDataSummaryByPeriod(
197
195
  .andWhere('summary.date >= :from', { from })
198
196
  .andWhere('summary.date < :to', { to })
199
197
  .addGroupBy('summary.dataSet')
200
- .addGroupBy('ds.name')
201
- .addGroupBy('ds.description')
202
198
  .addGroupBy(groupByPeriod)
203
199
 
204
200
  if (dataKeyItems.length > 0) {
@@ -207,7 +203,7 @@ export async function queryDataSummaryByPeriod(
207
203
 
208
204
  orderByPeriod.map(orderBy => {
209
205
  const { sort, order } = orderBy
210
- queryBuilder.addOrderBy(sort, order)
206
+ queryBuilder.orderBy(sort, order)
211
207
  })
212
208
 
213
209
  const items = await queryBuilder.getRawMany()