waibu-db 1.2.11 → 1.2.12

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.
@@ -4,7 +4,7 @@ async function detailsHandler ({ req, reply, model, params = {}, id, template, a
4
4
  const { pascalCase } = this.lib.aneka
5
5
  const { recordGet, getSchemaExt } = this.app.waibuDb
6
6
  const { merge } = this.lib._
7
- const opts = {}
7
+ const opts = { rels: '*' }
8
8
  model = model ?? pascalCase(req.params.model)
9
9
  const { schema } = await getSchemaExt(model, 'details', merge({}, { params }, options))
10
10
  if (schema.disabled.includes('get')) return await reply.view(templateDisabled, { action: 'details' })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "waibu-db",
3
- "version": "1.2.11",
3
+ "version": "1.2.12",
4
4
  "description": "DB Helper",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -38,10 +38,10 @@ function getCommons (action, schema, ext, options = {}) {
38
38
  set(schema, 'view.x', x)
39
39
  if (schema.disabled.length > 0) schema.view.disabled.push(...schema.disabled)
40
40
  let fields = []
41
+ const calcFieldNames = map(calcFields, 'name')
41
42
  for (const f of forFields) {
42
- if (allFields.includes(f)) fields.push(f)
43
+ if (calcFieldNames.includes(f) || allFields.includes(f)) fields.push(f)
43
44
  }
44
- if (calcFields.length > 0) fields.push(...map(calcFields, 'name'))
45
45
  fields = uniq(without(fields, ...hidden))
46
46
 
47
47
  options.forceShowId = options.forceShowId ?? true