mirror of
https://github.com/awatertrevi/infisical.git
synced 2026-09-22 13:39:35 +00:00
Merge pull request #2536 from Infisical/maidul-resolve-identity-count
Resolve identity count issue
This commit is contained in:
@@ -50,10 +50,6 @@ export const identityOrgDALFactory = (db: TDbClient) => {
|
|||||||
void paginatedFetchIdentity.whereILike(`${TableName.Identity}.name`, `%${search}%`);
|
void paginatedFetchIdentity.whereILike(`${TableName.Identity}.name`, `%${search}%`);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (limit) {
|
|
||||||
void paginatedFetchIdentity.offset(offset).limit(limit);
|
|
||||||
}
|
|
||||||
|
|
||||||
const query = (tx || db.replicaNode())(TableName.IdentityOrgMembership)
|
const query = (tx || db.replicaNode())(TableName.IdentityOrgMembership)
|
||||||
.where(filter)
|
.where(filter)
|
||||||
.join<Awaited<typeof paginatedFetchIdentity>>(paginatedFetchIdentity, (queryBuilder) => {
|
.join<Awaited<typeof paginatedFetchIdentity>>(paginatedFetchIdentity, (queryBuilder) => {
|
||||||
@@ -85,6 +81,10 @@ export const identityOrgDALFactory = (db: TDbClient) => {
|
|||||||
)
|
)
|
||||||
.orderBy(`${TableName.Identity}.${orderBy}`, orderDirection);
|
.orderBy(`${TableName.Identity}.${orderBy}`, orderDirection);
|
||||||
|
|
||||||
|
if (limit) {
|
||||||
|
void query.offset(offset).limit(limit);
|
||||||
|
}
|
||||||
|
|
||||||
const docs = await query;
|
const docs = await query;
|
||||||
const formattedDocs = sqlNestRelationships({
|
const formattedDocs = sqlNestRelationships({
|
||||||
data: docs,
|
data: docs,
|
||||||
|
|||||||
Reference in New Issue
Block a user