fix: fix no workspace problem when fetch all monitor events

This commit is contained in:
moonrailgun 2023-11-09 14:56:24 +08:00
parent a20cd8dff9
commit b050a56d4a

View File

@ -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',