diff --git a/src/server/trpc/routers/monitor.ts b/src/server/trpc/routers/monitor.ts index 7db03f0..34f9fb1 100644 --- a/src/server/trpc/routers/monitor.ts +++ b/src/server/trpc/routers/monitor.ts @@ -351,11 +351,12 @@ export const monitorRouter = router({ .input( z.object({ monitorId: z.string().cuid2().optional(), + limit: z.number().default(20), }) ) .output(z.array(monitorEventSchema)) .query(async ({ input }) => { - const { workspaceId, monitorId } = input; + const { workspaceId, monitorId, limit } = input; const list = await prisma.monitorEvent.findMany({ where: { @@ -367,7 +368,7 @@ export const monitorRouter = router({ orderBy: { createdAt: 'desc', }, - take: 20, + take: limit, }); return list;