From 336620a660395ebacfd734ea1cc80d00375e3866 Mon Sep 17 00:00:00 2001 From: Thomas Kaul <4159106+dtslvr@users.noreply.github.com> Date: Tue, 27 Feb 2024 20:39:12 +0100 Subject: [PATCH] Fix query to filter activities of excluded accounts --- apps/api/src/app/order/order.service.ts | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/apps/api/src/app/order/order.service.ts b/apps/api/src/app/order/order.service.ts index e60309856..a88aa4462 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([