waibu-db 2.10.0 → 2.10.2
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.
|
@@ -47,7 +47,7 @@ async function btnEdit () {
|
|
|
47
47
|
if (id.slice(-6) === '-split') {
|
|
48
48
|
const selector = '#' + id.replace('-split', '-menu') + ' a.dropdown-item'
|
|
49
49
|
const item = document.querySelector(selector)
|
|
50
|
-
item.href = href.replace('edit
|
|
50
|
+
item.href = href.replace('/edit?', '/add?') + '&mode=clone'
|
|
51
51
|
} else el.href = href
|
|
52
52
|
}
|
|
53
53
|
`
|
package/index.js
CHANGED
|
@@ -184,7 +184,7 @@ async function factory (pkgName) {
|
|
|
184
184
|
const unitSys = get(req, 'site.setting.sumba.unitSys')
|
|
185
185
|
const timeZone = get(req, 'site.setting.sumba.timeZone', this.app.bajo.config.intl.format.datetime.timeZone)
|
|
186
186
|
for (const f of fields) {
|
|
187
|
-
if (f === '
|
|
187
|
+
if (f === '_ref') continue
|
|
188
188
|
let prop = find(schema.properties, { name: f })
|
|
189
189
|
if (!prop) prop = find(schema.view.calcFields, { name: f })
|
|
190
190
|
if (!prop) continue
|
package/lib/util.js
CHANGED
|
@@ -54,10 +54,12 @@ export async function prepCrud ({ model, body, id, req, reply, transaction, opti
|
|
|
54
54
|
}
|
|
55
55
|
|
|
56
56
|
export async function getOneRecord (model, id, filter, options) {
|
|
57
|
-
const { cloneDeep } = this.app.lib._
|
|
57
|
+
const { cloneDeep, pick } = this.app.lib._
|
|
58
58
|
let query = cloneDeep(filter.query || {})
|
|
59
59
|
query = { $and: [query, { id }] }
|
|
60
|
-
const
|
|
60
|
+
const opts = pick(options, ['forceNoHidden', 'trx', 'req', 'refs'])
|
|
61
|
+
opts.dataOnly = true
|
|
62
|
+
const data = await model.findOneRecord({ query }, opts)
|
|
61
63
|
if (!data && options.throwNotFound) throw this.error('_notFound')
|
|
62
64
|
return data
|
|
63
65
|
}
|
package/package.json
CHANGED