From 6342f59d750996b10345958d34182837e7055934 Mon Sep 17 00:00:00 2001 From: RAHUL RATHORE <41804588+rahul-rocket@users.noreply.github.com> Date: Tue, 19 Mar 2024 12:11:08 +0530 Subject: [PATCH] fix: organization project members count for better sqlite3 --- .../organization-project.subscriber.ts | 20 ++++++++----------- 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/packages/core/src/organization-project/organization-project.subscriber.ts b/packages/core/src/organization-project/organization-project.subscriber.ts index cefb6119325..acc32e877a9 100644 --- a/packages/core/src/organization-project/organization-project.subscriber.ts +++ b/packages/core/src/organization-project/organization-project.subscriber.ts @@ -101,8 +101,7 @@ export class OrganizationProjectSubscriber extends BaseEntityEventSubscriber= 0) { // Common update logic for both ORMs if (em instanceof TypeOrmEntityManager) { - await em.query(updateQuery, [totalMembers, projectId]); + await em.query(updateQuery, [totalMembers, projectId, organizationId, tenantId]); } else if (em instanceof MikroOrmEntityManager) { // Replace $ placeholders with ? for MikroORM updateQuery = updateQuery.replace(/\$\d/g, '?'); - await em.getConnection().execute(updateQuery, [totalMembers, projectId]); + await em.getConnection().execute(updateQuery, [totalMembers, projectId, organizationId, tenantId]); } } } catch (error) { - console.error('OrganizationProjectSubscriber: An error occurred during the updateProjectMembersCount process:', error.message); + console.error('OrganizationProjectSubscriber: An error occurred during the updateProjectMembersCount process:', error); } } }