diff --git a/packages/plugin-ui-schema-storage/src/__tests__/server-hook-impl.test.ts b/packages/plugin-ui-schema-storage/src/__tests__/server-hook-impl.test.ts index f11ef14e06..b2770d3dc6 100644 --- a/packages/plugin-ui-schema-storage/src/__tests__/server-hook-impl.test.ts +++ b/packages/plugin-ui-schema-storage/src/__tests__/server-hook-impl.test.ts @@ -290,7 +290,7 @@ describe('server hooks', () => { 'x-server-hooks': [ { type: 'onSelfCreate', - method: 'bindMenuToRow', + method: 'bindMenuToRole', }, ], }, diff --git a/packages/plugin-ui-schema-storage/src/__tests__/ui-schema.test.ts b/packages/plugin-ui-schema-storage/src/__tests__/ui-schema.test.ts index 10decd3c69..168842212a 100644 --- a/packages/plugin-ui-schema-storage/src/__tests__/ui-schema.test.ts +++ b/packages/plugin-ui-schema-storage/src/__tests__/ui-schema.test.ts @@ -24,7 +24,7 @@ describe('ui-schema', () => { app.plugin(PluginUiSchema); - await app.load(); + await app.loadAndInstall(); uiSchemaRepository = db.getCollection('ui_schemas').repository as UiSchemaRepository; }); diff --git a/packages/plugin-ui-schema-storage/src/server-hooks/hooks/bind-menu-to-row.ts b/packages/plugin-ui-schema-storage/src/server-hooks/hooks/bind-menu-to-row.ts index 6e184992fe..296bc51262 100644 --- a/packages/plugin-ui-schema-storage/src/server-hooks/hooks/bind-menu-to-row.ts +++ b/packages/plugin-ui-schema-storage/src/server-hooks/hooks/bind-menu-to-row.ts @@ -1,6 +1,4 @@ -import { BelongsToManyRepository } from '@nocobase/database'; - -export async function bindMenuToRow({ schemaInstance, db, options }) { +export async function bindMenuToRole({ schemaInstance, db, options }) { const { transaction } = options; const addNewMenuRoles = await db.getRepository('roles').find({ filter: { diff --git a/packages/plugin-ui-schema-storage/src/server-hooks/hooks/index.ts b/packages/plugin-ui-schema-storage/src/server-hooks/hooks/index.ts index 8ffe5d94bd..5af51a46ee 100644 --- a/packages/plugin-ui-schema-storage/src/server-hooks/hooks/index.ts +++ b/packages/plugin-ui-schema-storage/src/server-hooks/hooks/index.ts @@ -1,11 +1,11 @@ import { hookFactory } from './factory'; import { removeSchema } from './remove-schema'; -import { bindMenuToRow } from './bind-menu-to-row'; +import { bindMenuToRole } from './bind-menu-to-row'; const hooks = [ hookFactory('onCollectionDestroy', 'removeSchema', removeSchema), hookFactory('onCollectionFieldDestroy', 'removeSchema', removeSchema), - hookFactory('onSelfCreate', 'bindMenuToRow', bindMenuToRow), + hookFactory('onSelfCreate', 'bindMenuToRole', bindMenuToRole), ]; export { hooks };