This commit is contained in:
Fu Diwei 2025-03-06 15:54:29 +08:00
parent 6d612f42a8
commit 9aaf3ff5d8
3 changed files with 4 additions and 10 deletions

View File

@ -13,8 +13,7 @@ const NotifyChannelEditFormBarkFields = () => {
.nullish(),
deviceKey: z
.string({ message: t("settings.notification.channel.form.bark_device_key.placeholder") })
.min(1, t("settings.notification.channel.form.bark_device_key.placeholder"))
.max(256, t("common.errmsg.string_max", { max: 256 })),
.nonempty(t("settings.notification.channel.form.bark_device_key.placeholder")),
});
const formRule = createSchemaFieldRule(formSchema);

View File

@ -9,12 +9,10 @@ const NotifyChannelEditFormDingTalkFields = () => {
const formSchema = z.object({
accessToken: z
.string({ message: t("settings.notification.channel.form.dingtalk_access_token.placeholder") })
.min(1, t("settings.notification.channel.form.dingtalk_access_token.placeholder"))
.max(256, t("common.errmsg.string_max", { max: 256 })),
.nonempty(t("settings.notification.channel.form.dingtalk_access_token.placeholder")),
secret: z
.string({ message: t("settings.notification.channel.form.dingtalk_secret.placeholder") })
.min(1, t("settings.notification.channel.form.dingtalk_secret.placeholder"))
.max(64, t("common.errmsg.string_max", { max: 64 })),
.nonempty(t("settings.notification.channel.form.dingtalk_secret.placeholder")),
});
const formRule = createSchemaFieldRule(formSchema);

View File

@ -7,10 +7,7 @@ const NotifyChannelEditFormWeComFields = () => {
const { t } = useTranslation();
const formSchema = z.object({
webhookUrl: z
.string({ message: t("settings.notification.channel.form.wecom_webhook_url.placeholder") })
.min(1, t("settings.notification.channel.form.wecom_webhook_url.placeholder"))
.url({ message: t("common.errmsg.url_invalid") }),
webhookUrl: z.string({ message: t("settings.notification.channel.form.wecom_webhook_url.placeholder") }).url({ message: t("common.errmsg.url_invalid") }),
});
const formRule = createSchemaFieldRule(formSchema);