From b050a56d4a2bf516b810283f51e8f43c6143d41a Mon Sep 17 00:00:00 2001 From: moonrailgun Date: Thu, 9 Nov 2023 14:56:24 +0800 Subject: [PATCH] fix: fix no workspace problem when fetch all monitor events --- src/server/trpc/routers/monitor.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/server/trpc/routers/monitor.ts b/src/server/trpc/routers/monitor.ts index fbc311e..d976bbc 100644 --- a/src/server/trpc/routers/monitor.ts +++ b/src/server/trpc/routers/monitor.ts @@ -355,11 +355,14 @@ export const monitorRouter = router({ ) .output(z.array(monitorEventSchema)) .query(async ({ input }) => { - const { monitorId } = input; + const { workspaceId, monitorId } = input; const list = await prisma.monitorEvent.findMany({ where: { monitorId, + monitor: { + workspaceId: workspaceId, + }, }, orderBy: { createdAt: 'desc',