Allow user to select logs

This commit is contained in:
David Corbitt
2023-08-12 04:07:58 -07:00
parent 89815e1f7f
commit 33751c12d2
5 changed files with 71 additions and 20 deletions

View File

@@ -19,10 +19,15 @@ export const loggedCallsRouter = createTRPCRouter({
take: pageSize,
});
const matchingLogs = await prisma.loggedCall.findMany({
where: { projectId },
select: { id: true },
});
const count = await prisma.loggedCall.count({
where: { projectId },
});
return { count, calls };
return { calls, count, matchingLogIds: matchingLogs.map((log) => log.id) };
}),
});