waibu-db 2.25.2 → 2.26.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/lib/method/get-schema-ext.js +6 -1
- package/package.json +1 -1
- package/wiki/CHANGES.md +1 -0
|
@@ -196,7 +196,7 @@ 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 } = this.app.lib._
|
|
199
|
+
const { pick, isString, get } = this.app.lib._
|
|
200
200
|
|
|
201
201
|
const model = isString(modelName) ? this.app.dobo.getModel(modelName) : modelName
|
|
202
202
|
const ns = model.plugin.ns
|
|
@@ -208,6 +208,11 @@ async function getSchemaExt (modelName, view, options = {}) {
|
|
|
208
208
|
ext = defaultsDeep(options.schema ?? {}, ext)
|
|
209
209
|
await handler[view].call(this, schema, ext, options)
|
|
210
210
|
delete schema.model
|
|
211
|
+
const req = get(options, 'args.0.req')
|
|
212
|
+
if (req && req.routeOptions.config.mainSiteEdit && req.site.alias !== 'default') {
|
|
213
|
+
schema.disabled = schema.disabled ?? []
|
|
214
|
+
schema.disabled.push('create', 'update', 'remove')
|
|
215
|
+
}
|
|
211
216
|
return { schema, ext, model }
|
|
212
217
|
}
|
|
213
218
|
|
package/package.json
CHANGED