fix: typo
This commit is contained in:
		
							parent
							
								
									c9643ac2b7
								
							
						
					
					
						commit
						ac2b05f04c
					
				@ -290,7 +290,7 @@ describe('server hooks', () => {
 | 
			
		||||
          'x-server-hooks': [
 | 
			
		||||
            {
 | 
			
		||||
              type: 'onSelfCreate',
 | 
			
		||||
              method: 'bindMenuToRow',
 | 
			
		||||
              method: 'bindMenuToRole',
 | 
			
		||||
            },
 | 
			
		||||
          ],
 | 
			
		||||
        },
 | 
			
		||||
 | 
			
		||||
@ -24,7 +24,7 @@ describe('ui-schema', () => {
 | 
			
		||||
 | 
			
		||||
    app.plugin(PluginUiSchema);
 | 
			
		||||
 | 
			
		||||
    await app.load();
 | 
			
		||||
    await app.loadAndInstall();
 | 
			
		||||
    uiSchemaRepository = db.getCollection('ui_schemas').repository as UiSchemaRepository;
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
@ -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: {
 | 
			
		||||
 | 
			
		||||
@ -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 };
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user