1 parent
0c184e6d0c
commit
466d356ad1
2 files changed
+5
-8
No files matched your search
@@ -35,11 +35,7 @@ const rocketChatSchema = baseSchema.extend({
|
|||||||
address: z
|
address: z
|
||||||
.string()
|
.string()
|
||||||
.min(1, "Webhook URL is required")
|
.min(1, "Webhook URL is required")
|
||||||
.url("Please enter a valid URL")
|
.url({ protocol: /^https?$/, message: "Please enter a valid URL" }),
|
||||||
.refine(
|
|
||||||
(url) => /^https?:\/\//i.test(url),
|
|
||||||
"Rocket.Chat webhook URL must use HTTP or HTTPS"
|
|
||||||
),
|
|
||||||
});
|
});
|
||||||
|
|
||||||
const pagerDutySchema = baseSchema.extend({
|
const pagerDutySchema = baseSchema.extend({
|
||||||
|
|||||||
@@ -27,9 +27,10 @@ export const createNotificationBodyValidation = z.discriminatedUnion("type", [
|
|||||||
z.object({
|
z.object({
|
||||||
notificationName: z.string().min(1, "Notification name is required"),
|
notificationName: z.string().min(1, "Notification name is required"),
|
||||||
type: z.literal("rocket_chat"),
|
type: z.literal("rocket_chat"),
|
||||||
address: z
|
address: z.url({
|
||||||
.url({ message: "Please enter a valid Rocket.Chat webhook URL" })
|
protocol: /^https?$/,
|
||||||
.refine((url) => /^https?:\/\//i.test(url), { message: "Rocket.Chat webhook URL must use HTTP or HTTPS" }),
|
message: "Please enter a valid Rocket.Chat webhook URL",
|
||||||
|
}),
|
||||||
}),
|
}),
|
||||||
// Slack notification
|
// Slack notification
|
||||||
z.object({
|
z.object({
|
||||||
|
|||||||
Reference in new issue
Block a user