From d3679d41b31cb31e9ac2718cd519a4158dffe8cb Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:58:04 +0100 Subject: [PATCH] Bugfix/fix query to filter activities of excluded accounts (#3059) * Fix query to filter activities of excluded accounts * Update changelog --- CHANGELOG.md | 1 + apps/api/src/app/order/order.service.ts | 15 +++++---------- 2 files changed, 6 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 73683ccb..2020f58d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed +- Fixed the query to filter activities of excluded accounts - Improved the asset profile validation in the activities import ## 2.57.0 - 2024-02-25 diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index e6030985..a88aa446 100644 --- a/apps/api/src/app/order/order.service.ts +++ b/apps/api/src/app/order/order.service.ts @@ -292,19 +292,14 @@ export class OrderService { } if (types) { - where.OR = types.map((type) => { - return { - type: { - equals: type - } - }; - }); + where.type = { in: types }; } if (withExcludedAccounts === false) { - where.Account = { - NOT: { isExcluded: true } - }; + where.OR = [ + { Account: null }, + { Account: { NOT: { isExcluded: true } } } + ]; } const [orders, count] = await Promise.all([