waibu-db 2.26.0 → 2.26.1
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/lib/method/get-schema-ext.js +4 -2
- package/package.json +1 -1
- package/wiki/CHANGES.md +4 -0
|
@@ -196,11 +196,11 @@ const handler = {
|
|
|
196
196
|
async function getSchemaExt (modelName, view, options = {}) {
|
|
197
197
|
const { readConfig } = this.app.bajo
|
|
198
198
|
const { defaultsDeep } = this.app.lib.aneka
|
|
199
|
-
const { pick, isString, get } = this.app.lib._
|
|
199
|
+
const { pick, isString, get, cloneDeep } = this.app.lib._
|
|
200
200
|
|
|
201
201
|
const model = isString(modelName) ? this.app.dobo.getModel(modelName) : modelName
|
|
202
202
|
const ns = model.plugin.ns
|
|
203
|
-
const schema = pick(model, ['name', 'properties', 'indexes', 'disabled', 'sortables', 'scanables', 'view', 'hidden', 'options'])
|
|
203
|
+
const schema = pick(cloneDeep(model), ['name', 'properties', 'indexes', 'disabled', 'sortables', 'scanables', 'view', 'hidden', 'options'])
|
|
204
204
|
schema.ns = ns
|
|
205
205
|
schema.model = model
|
|
206
206
|
const parserOpts = { args: options.args }
|
|
@@ -212,6 +212,8 @@ async function getSchemaExt (modelName, view, options = {}) {
|
|
|
212
212
|
if (req && req.routeOptions.config.mainSiteEdit && req.site.alias !== 'default') {
|
|
213
213
|
schema.disabled = schema.disabled ?? []
|
|
214
214
|
schema.disabled.push('create', 'update', 'remove')
|
|
215
|
+
schema.view.disabled = schema.view.disabled ?? []
|
|
216
|
+
schema.view.disabled.push(...schema.disabled)
|
|
215
217
|
}
|
|
216
218
|
return { schema, ext, model }
|
|
217
219
|
}
|
package/package.json
CHANGED