fix: address PR review feedback and add Zod validation constraints

This commit is contained in:
ashu130698 committed 2026-03-20 23:39:38 +05:30
1 parent 1706012e54
commit 1e6cf858c4
5 files changed
+11 -5

No files matched your search

@@ -103,4 +103,10 @@ export const updateNotificationsValidation = z.object({
monitorIds: z.array(z.string()).min(1, "At least one monitor ID is required"),
notificationIds: z.array(z.string()),
action: z.enum(["add", "remove", "set"] as const),
}).refine((data) => {
if (data.action !== "set" && data.notificationIds.length === 0) return false;
return true;
}, {
message: "Notification IDs cannot be empty unless action is 'set'",
path: ["notificationIds"],
});