diff --git a/server/private/routers/eventStreamingDestination/updateEventStreamingDestination.ts b/server/private/routers/eventStreamingDestination/updateEventStreamingDestination.ts index 1ad8f0081..3d3321824 100644 --- a/server/private/routers/eventStreamingDestination/updateEventStreamingDestination.ts +++ b/server/private/routers/eventStreamingDestination/updateEventStreamingDestination.ts @@ -22,7 +22,7 @@ import logger from "@server/logger"; import { fromError } from "zod-validation-error"; import { OpenAPITags, registry } from "@server/openApi"; import { and, eq } from "drizzle-orm"; -import { parse } from "zod/v4/core"; + const paramsSchema = z .object({ @@ -35,10 +35,10 @@ const bodySchema = z.strictObject({ type: z.string().optional(), config: z.string().optional(), enabled: z.boolean().optional(), - sendConnectionLogs: z.boolean().optional().default(false), - sendRequestLogs: z.boolean().optional().default(false), - sendActionLogs: z.boolean().optional().default(false), - sendAccessLogs: z.boolean().optional().default(false) + sendConnectionLogs: z.boolean().optional(), + sendRequestLogs: z.boolean().optional(), + sendActionLogs: z.boolean().optional(), + sendAccessLogs: z.boolean().optional() }); export type UpdateEventStreamingDestinationResponse = { @@ -110,7 +110,19 @@ export async function updateEventStreamingDestination( ); } - const updateData = parsedBody.data; + const { type, config, enabled, sendAccessLogs, sendActionLogs, sendConnectionLogs, sendRequestLogs } = parsedBody.data; + + const updateData: Record = { + updatedAt: Date.now() + }; + + if (type !== undefined) updateData.type = type; + if (config !== undefined) updateData.config = config; + if (enabled !== undefined) updateData.enabled = enabled; + if (sendAccessLogs !== undefined) updateData.sendAccessLogs = sendAccessLogs; + if (sendActionLogs !== undefined) updateData.sendActionLogs = sendActionLogs; + if (sendConnectionLogs !== undefined) updateData.sendConnectionLogs = sendConnectionLogs; + if (sendRequestLogs !== undefined) updateData.sendRequestLogs = sendRequestLogs; await db .update(eventStreamingDestinations) diff --git a/src/app/[orgId]/settings/logs/streaming/page.tsx b/src/app/[orgId]/settings/logs/streaming/page.tsx index c732274b4..a89c961b4 100644 --- a/src/app/[orgId]/settings/logs/streaming/page.tsx +++ b/src/app/[orgId]/settings/logs/streaming/page.tsx @@ -27,7 +27,8 @@ import { Switch } from "@app/components/ui/switch"; import { HorizontalTabs } from "@app/components/HorizontalTabs"; import { RadioGroup, RadioGroupItem } from "@app/components/ui/radio-group"; import { Textarea } from "@app/components/ui/textarea"; -import { Globe, Plus, Trash2, X } from "lucide-react"; +import { Checkbox } from "@app/components/ui/checkbox"; +import { Globe, Plus, X } from "lucide-react"; import { AxiosResponse } from "axios"; import { build } from "@server/build"; @@ -54,6 +55,10 @@ interface Destination { type: string; config: string; enabled: boolean; + sendAccessLogs: boolean; + sendActionLogs: boolean; + sendConnectionLogs: boolean; + sendRequestLogs: boolean; createdAt: number; updatedAt: number; } @@ -215,7 +220,7 @@ function DestinationCard({ {/* Footer: edit button */}
)}