Browse Source

Fix query to filter activities of excluded accounts

pull/3059/head
Thomas Kaul 2 years ago
parent
commit
336620a660
  1. 15
      apps/api/src/app/order/order.service.ts

15
apps/api/src/app/order/order.service.ts

@ -292,19 +292,14 @@ export class OrderService {
} }
if (types) { if (types) {
where.OR = types.map((type) => { where.type = { in: types };
return {
type: {
equals: type
}
};
});
} }
if (withExcludedAccounts === false) { if (withExcludedAccounts === false) {
where.Account = { where.OR = [
NOT: { isExcluded: true } { Account: null },
}; { Account: { NOT: { isExcluded: true } } }
];
} }
const [orders, count] = await Promise.all([ const [orders, count] = await Promise.all([

Loading…
Cancel
Save