waibu-db 2.24.1 → 2.25.0
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/index.js +1 -2
- package/lib/crud/export-handler.js +2 -3
- package/package.json +1 -1
- package/wiki/CHANGES.md +4 -0
package/index.js
CHANGED
|
@@ -74,11 +74,10 @@ async function factory (pkgName) {
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
exportData = async (params) => {
|
|
77
|
-
const { getPlugin } = this.app.bajo
|
|
78
77
|
const { get } = this.app.lib._
|
|
79
78
|
const { fs } = this.app.lib
|
|
80
79
|
const { exportTo } = this.app.doboExtra
|
|
81
|
-
const { downloadDir } = getPlugin('sumba')
|
|
80
|
+
const { downloadDir } = this.app.getPlugin('sumba')
|
|
82
81
|
const model = get(params, 'payload.data.name')
|
|
83
82
|
const fields = get(params, 'payload.data.opts.fields')
|
|
84
83
|
const { id, file } = get(params, 'payload.data.download', {})
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { prepCrud } from '../util.js'
|
|
2
2
|
|
|
3
3
|
async function exportHandler ({ req, reply, model, params = {}, templateDisabled = 'waibuDb.template:/disabled.html', options = {} } = {}) {
|
|
4
|
-
const { getPlugin } = this.app.bajo
|
|
5
4
|
const { dayjs } = this.app.lib
|
|
6
5
|
const { omit, kebabCase, get, merge } = this.app.lib._
|
|
7
6
|
const { pascalCase } = this.app.lib.aneka
|
|
8
7
|
const { getSchemaExt } = this.app.waibuDb
|
|
9
8
|
const { buildUrl } = this.app.waibuMpa
|
|
10
|
-
const { pushDownload } = getPlugin('sumba')
|
|
9
|
+
const { pushDownload } = this.app.getPlugin('sumba')
|
|
11
10
|
model = pascalCase(model ?? req.params.model)
|
|
12
11
|
const mdl = this.app.dobo.getModel(model)
|
|
13
12
|
const { schema } = await getSchemaExt(model, 'add', merge({ args: [{ req, model: mdl }] }, { params }, options))
|
|
14
13
|
if (schema.disabled.includes('find')) return await reply.view(templateDisabled, { action: 'list' })
|
|
15
|
-
const data = await prepCrud.call(getPlugin('waibuDb'), { model, req, reply, args: ['model'] })
|
|
14
|
+
const data = await prepCrud.call(this.app.getPlugin('waibuDb'), { model, req, reply, args: ['model'] })
|
|
16
15
|
data.opts = omit(data.opts, ['req', 'reply'])
|
|
17
16
|
const source = `${this.name}:/export-handler`
|
|
18
17
|
const worker = 'waibuDb:exportData'
|
package/package.json
CHANGED