q-koa 10.0.3 → 10.0.4

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/core/app.js CHANGED
@@ -254,6 +254,9 @@ class APP {
254
254
  ) {
255
255
  this.app[appName].model.log.upsert(errorData)
256
256
  }
257
+ if (process.env.NODE_ENV !== 'production') {
258
+ console.log(err.stack)
259
+ }
257
260
  throw new Error(err.message)
258
261
  })
259
262
 
@@ -181,3 +181,13 @@ exports.bulkCreateList = {
181
181
  allowNull: false,
182
182
  defaultValue: [],
183
183
  }
184
+
185
+ exports.alias = {
186
+ type: Sequelize.VIRTUAL,
187
+ comment: 'alias',
188
+ get: function () {
189
+ const name = this.getDataValue('name')
190
+ const model = this.getDataValue('model')
191
+ return name + model
192
+ },
193
+ }
@@ -7,13 +7,16 @@ module.exports = {
7
7
  select: [
8
8
  { key: 'parent_id' },
9
9
  {
10
- key: 'key',
11
- symbol: '$like',
10
+ key: 'model_id',
12
11
  },
13
12
  {
14
13
  key: 'url',
15
14
  symbol: '$like',
16
15
  },
16
+ {
17
+ key: 'key',
18
+ symbol: '$like',
19
+ },
17
20
  ],
18
21
  excludes: [],
19
22
  limit: 40,
@@ -48,6 +48,9 @@ exports.model_id = {
48
48
  defaultValue: 0,
49
49
  sortOrder: 5,
50
50
  mock: () => Random.integer(1, 5),
51
+ extra: {
52
+ key_name: 'alias',
53
+ },
51
54
  }
52
55
 
53
56
  exports.sortOrder = {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "q-koa",
3
- "version": "10.0.3",
3
+ "version": "10.0.4",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "scripts": {