Skip to content

Open-source status page, incident response and uptime monitoring

chore: include provider in notification event (#1323)

Maximilian Kaske616be6c054e7
diff --git a/apps/server/src/routes/v1/notifications/post.ts b/apps/server/src/routes/v1/notifications/post.ts
index c778e0f43..a622d436b 100644
--- a/apps/server/src/routes/v1/notifications/post.ts
+++ b/apps/server/src/routes/v1/notifications/post.ts
@@ -19,7 +19,7 @@ const postRoute = createRoute({
tags: ["notification"],
summary: "Create a notification",
path: "/",
- middleware: [trackMiddleware(Events.CreateNotification)],
+ middleware: [trackMiddleware(Events.CreateNotification, ["provider"])],
request: {
body: {
description: "The notification to create",
diff --git a/packages/api/src/router/notification.ts b/packages/api/src/router/notification.ts
index 0838a0d39..9c09b57e7 100644
--- a/packages/api/src/router/notification.ts
+++ b/packages/api/src/router/notification.ts
@@ -19,7 +19,7 @@ import { createTRPCRouter, protectedProcedure } from "../trpc";
export const notificationRouter = createTRPCRouter({
create: protectedProcedure
- .meta({ track: Events.CreateNotification })
+ .meta({ track: Events.CreateNotification, trackProps: ["provider"] })
.input(insertNotificationSchema)
.mutation(async (opts) => {
const { monitors, ...props } = opts.input;
@@ -327,7 +327,7 @@ export const notificationRouter = createTRPCRouter({
}),
new: protectedProcedure
- .meta({ track: Events.CreateNotification })
+ .meta({ track: Events.CreateNotification, trackProps: ["provider"] })
.input(
z.object({
provider: z.enum(notificationProvider),