Skip to content

Commit

Permalink
perf(workflows-service): removed query that is performance heavy
Browse files Browse the repository at this point in the history
  • Loading branch information
Omri-Levy committed Jul 9, 2024
1 parent f8bb260 commit 6269bfc
Showing 1 changed file with 3 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -138,13 +138,6 @@ export class CaseManagementController {
activeMonitorings: true,
updatedAt: true,
},
where: {
Counterparty: {
every: {
endUserId: null,
},
},
},
take: searchQueryParams.page.size,
skip: (searchQueryParams.page.number - 1) * searchQueryParams.page.size,
},
Expand All @@ -161,19 +154,19 @@ export class CaseManagementController {
tags: string[];
}>;
businesses: Array<Pick<Business, 'companyName'>>;
Counterparty: {
Counterparty: Array<{
alerts: Array<{
id: string;
}>;
};
}>;
}
>;

return typedEndUsers.map(endUser => {
const tag = endUser.workflowRuntimeData?.[0]?.tags?.find(
tag => !!tagToKyc[tag as keyof typeof tagToKyc],
);
const alerts = endUser.Counterparty?.alerts;
const alerts = endUser.Counterparty?.flatMap(({ alerts }) => alerts);
const checkIsMonitored = () =>
Array.isArray(endUser.activeMonitorings) && !!endUser.activeMonitorings?.length;
const getMatches = () => {
Expand Down

0 comments on commit 6269bfc

Please sign in to comment.