fix: typo

This commit is contained in:
Chareice 2022-02-10 23:08:13 +08:00 committed by chenos
parent c9643ac2b7
commit ac2b05f04c
4 changed files with 5 additions and 7 deletions

View File

@ -290,7 +290,7 @@ describe('server hooks', () => {
'x-server-hooks': [
{
type: 'onSelfCreate',
method: 'bindMenuToRow',
method: 'bindMenuToRole',
},
],
},

View File

@ -24,7 +24,7 @@ describe('ui-schema', () => {
app.plugin(PluginUiSchema);
await app.load();
await app.loadAndInstall();
uiSchemaRepository = db.getCollection('ui_schemas').repository as UiSchemaRepository;
});

View File

@ -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: {

View File

@ -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 };