fix: delete collection load middleware
This commit is contained in:
		
							parent
							
								
									9d95a27a7f
								
							
						
					
					
						commit
						dba1f1fbc6
					
				@ -33,14 +33,4 @@ export default async function (this: Application, options = {}) {
 | 
			
		||||
      Model.addHook(hookKey, hooks[modelName][hookKey]);
 | 
			
		||||
    });
 | 
			
		||||
  });
 | 
			
		||||
 | 
			
		||||
  let initialized = false;
 | 
			
		||||
 | 
			
		||||
  this.use(async (ctx, next) => {
 | 
			
		||||
    if (!initialized) {
 | 
			
		||||
      await database.getModel('collections').load({skipExisting: true});
 | 
			
		||||
      initialized = true;
 | 
			
		||||
    }
 | 
			
		||||
    await next();
 | 
			
		||||
  });
 | 
			
		||||
}
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user