fix(plugin-error-handler): cannot find module '@formily/json-schema'
This commit is contained in:
parent
2b3cd45ca1
commit
14f30e61e8
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@nocobase/plugin-error-handler",
|
"name": "@nocobase/plugin-error-handler",
|
||||||
"version": "0.7.0-alpha.7",
|
"version": "0.7.0-alpha.9",
|
||||||
"description": "",
|
"description": "",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"licenses": [
|
"licenses": [
|
||||||
@ -17,7 +17,8 @@
|
|||||||
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
"build:esm": "tsc --project tsconfig.build.json --module es2015 --outDir esm"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@nocobase/server": "0.7.0-alpha.7"
|
"@formily/json-schema": "^2.0.15",
|
||||||
|
"@nocobase/server": "0.7.0-alpha.9"
|
||||||
},
|
},
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { compile } from '@formily/json-schema/lib/compiler';
|
import { Schema } from '@formily/json-schema';
|
||||||
import { Plugin } from '@nocobase/server';
|
import { Plugin } from '@nocobase/server';
|
||||||
import lodash from 'lodash';
|
import lodash from 'lodash';
|
||||||
import { BaseError } from 'sequelize';
|
import { BaseError } from 'sequelize';
|
||||||
@ -27,7 +27,7 @@ export class PluginErrorHandler extends Plugin {
|
|||||||
const model = instance.constructor;
|
const model = instance.constructor;
|
||||||
const collection = this.db.modelCollection.get(model);
|
const collection = this.db.modelCollection.get(model);
|
||||||
const field = collection.getField(path);
|
const field = collection.getField(path);
|
||||||
const fieldOptions = compile(field.options, { t: tFunc });
|
const fieldOptions = Schema.compile(field.options, { t: tFunc });
|
||||||
const title = lodash.get(fieldOptions, 'uiSchema.title', path);
|
const title = lodash.get(fieldOptions, 'uiSchema.title', path);
|
||||||
return title;
|
return title;
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user