From 157e3d2ef905da8e33082dcdec9819e1bc2c6738 Mon Sep 17 00:00:00 2001 From: Chareice Date: Sun, 14 Jan 2024 17:34:35 +0800 Subject: [PATCH] chore: test --- packages/core/actions/src/utils.ts | 4 ++-- packages/core/server/src/middlewares/acl-selector.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/packages/core/actions/src/utils.ts b/packages/core/actions/src/utils.ts index eb7de1423c..0afa0730d0 100644 --- a/packages/core/actions/src/utils.ts +++ b/packages/core/actions/src/utils.ts @@ -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(resourceName, resourceOf); diff --git a/packages/core/server/src/middlewares/acl-selector.ts b/packages/core/server/src/middlewares/acl-selector.ts index 7c0d1b1671..ba72e44bb8 100644 --- a/packages/core/server/src/middlewares/acl-selector.ts +++ b/packages/core/server/src/middlewares/acl-selector.ts @@ -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);