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([