chore: test

This commit is contained in:
Chareice 2024-01-14 17:34:35 +08:00
parent 1214717f82
commit 157e3d2ef9
No known key found for this signature in database
2 changed files with 4 additions and 4 deletions

View File

@ -17,8 +17,8 @@ export function pageArgsToLimitArgs(
export function getRepositoryFromParams(ctx: Context) {
const { resourceName, resourceOf } = ctx.action;
const databaseName = ctx.get('x-database');
const database = ctx.app.getDb(databaseName || 'main') as Database;
const connectionName = ctx.get('x-connection');
const database = ctx.app.getDb(connectionName || 'main') as Database;
if (resourceOf) {
return database.getRepository<MultipleRelationRepository>(resourceName, resourceOf);

View File

@ -1,7 +1,7 @@
export function AclSelectorMiddleware() {
return async (ctx, next) => {
const databaseName = ctx.get('x-database');
const aclInstance = databaseName ? ctx.app.acls.get(databaseName) : ctx.app.acl;
const connectionName = ctx.get('x-connection');
const aclInstance = connectionName ? ctx.app.acls.get(connectionName) : ctx.app.acl;
const middleware = aclInstance.middleware();
await middleware(ctx, next);