Skip to content

Infisical is the open-source platform for securing secrets, certificates, access, and AI Agents.

resolve identity count

Maidul Islam3eefb98f3036
diff --git a/backend/src/services/identity/identity-org-dal.ts b/backend/src/services/identity/identity-org-dal.ts
index 1bea4c9f47..fed6df5658 100644
--- a/backend/src/services/identity/identity-org-dal.ts
+++ b/backend/src/services/identity/identity-org-dal.ts
@@ -50,10 +50,6 @@ export const identityOrgDALFactory = (db: TDbClient) => {
void paginatedFetchIdentity.whereILike(`${TableName.Identity}.name`, `%${search}%`);
}
- if (limit) {
- void paginatedFetchIdentity.offset(offset).limit(limit);
- }
-
const query = (tx || db.replicaNode())(TableName.IdentityOrgMembership)
.where(filter)
.join<Awaited<typeof paginatedFetchIdentity>>(paginatedFetchIdentity, (queryBuilder) => {
@@ -85,6 +81,10 @@ export const identityOrgDALFactory = (db: TDbClient) => {
)
.orderBy(`${TableName.Identity}.${orderBy}`, orderDirection);
+ if (limit) {
+ void query.offset(offset).limit(limit);
+ }
+
const docs = await query;
const formattedDocs = sqlNestRelationships({
data: docs,