From 9cdcfc50057f4f261ccd61d5253a632c2a02cd3e Mon Sep 17 00:00:00 2001 From: luisburigo Date: Thu, 8 May 2025 13:20:31 -0300 Subject: [PATCH 1/2] hotfix: improve latest transaction query --- packages/api/src/modules/user/controller.ts | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/api/src/modules/user/controller.ts b/packages/api/src/modules/user/controller.ts index 69bc3e173..5a46adce9 100644 --- a/packages/api/src/modules/user/controller.ts +++ b/packages/api/src/modules/user/controller.ts @@ -79,17 +79,12 @@ export class UserController { async meTransactions(req: IMeRequest) { try { const { type } = req.query; - const { workspace, user, network } = req; + const { user, network } = req; - const { hasSingle } = await new UserService().workspacesByUser( - workspace, - user, - ); const transactions = await new TransactionService() .filter({ type, - workspaceId: [workspace.id], - signer: hasSingle ? user.address : undefined, + signer: user.address, network: network.url, }) .paginate({ page: '0', perPage: '6' }) From 65470bb93933583d10fdd6eb88bc595866f6cf80 Mon Sep 17 00:00:00 2001 From: luisburigo Date: Thu, 8 May 2025 13:46:09 -0300 Subject: [PATCH 2/2] hotfix: improve transaction list query --- packages/api/src/modules/transaction/services.ts | 12 +----------- 1 file changed, 1 insertion(+), 11 deletions(-) diff --git a/packages/api/src/modules/transaction/services.ts b/packages/api/src/modules/transaction/services.ts index 44a895c35..47f6659ff 100644 --- a/packages/api/src/modules/transaction/services.ts +++ b/packages/api/src/modules/transaction/services.ts @@ -205,14 +205,9 @@ export class TransactionService implements ITransactionService { }); // =============== specific for workspace =============== - if (this._filter.workspaceId || this._filter.signer) { + if (this._filter.signer) { queryBuilder.andWhere( new Brackets(qb => { - if (this._filter.workspaceId) { - qb.orWhere('workspace.id IN (:...workspace)', { - workspace: this._filter.workspaceId, - }); - } if (this._filter.signer) { qb.orWhere('members.address = :signer', { signer: this._filter.signer, @@ -361,11 +356,6 @@ export class TransactionService implements ITransactionService { if (this._filter.workspaceId || this._filter.signer) { queryBuilder.andWhere( new Brackets(qb => { - if (this._filter.workspaceId) { - qb.orWhere('workspace.id IN (:...workspace)', { - workspace: this._filter.workspaceId, - }); - } if (this._filter.signer) { qb.orWhere('members.address = :signer', { signer: this._filter.signer,