chore: remove unused code

This commit is contained in:
Fu Diwei
2024-12-31 20:05:48 +08:00
parent 6f088fd76a
commit 9c645a1efa
72 changed files with 98 additions and 6932 deletions

View File

@@ -17,28 +17,20 @@ const SettingsPassword = () => {
const [messageApi, MessageContextHolder] = message.useMessage();
const [notificationApi, NotificationContextHolder] = notification.useNotification();
const formSchema = z
.object({
oldPassword: z
.string({ message: t("settings.password.form.old_password.placeholder") })
.min(10, { message: t("settings.password.form.password.errmsg.invalid") }),
newPassword: z
.string({ message: t("settings.password.form.new_password.placeholder") })
.min(10, { message: t("settings.password.form.password.errmsg.invalid") }),
confirmPassword: z
.string({ message: t("settings.password.form.confirm_password.placeholder") })
.min(10, { message: t("settings.password.form.password.errmsg.invalid") }),
})
.refine((data) => data.newPassword === data.confirmPassword, {
message: t("settings.password.form.password.errmsg.not_matched"),
path: ["confirmPassword"],
});
const formSchema = z.object({
oldPassword: z.string({ message: t("settings.password.form.old_password.placeholder") }).min(10, t("settings.password.form.password.errmsg.invalid")),
newPassword: z.string({ message: t("settings.password.form.new_password.placeholder") }).min(10, t("settings.password.form.password.errmsg.invalid")),
confirmPassword: z
.string({ message: t("settings.password.form.confirm_password.placeholder") })
.min(10, t("settings.password.form.password.errmsg.invalid"))
.refine((v) => v === formInst.getFieldValue("newPassword"), t("settings.password.form.password.errmsg.not_matched")),
});
const formRule = createSchemaFieldRule(formSchema);
const {
form: formInst,
formPending,
formProps,
} = useAntdForm<z.infer<typeof formSchema>>({
} = useAntdForm({
onSubmit: async (values) => {
try {
await getPocketBase().admins.authWithPassword(getPocketBase().authStore.model?.email, values.oldPassword);

View File

@@ -197,14 +197,13 @@ const WorkflowBaseInfoModalForm = ({
const formSchema = z.object({
name: z
.string({ message: t("workflow.baseinfo.form.name.placeholder") })
.trim()
.min(1, t("workflow.baseinfo.form.name.placeholder"))
.max(64, t("common.errmsg.string_max", { max: 64 })),
.max(64, t("common.errmsg.string_max", { max: 64 }))
.trim(),
description: z
.string({ message: t("workflow.baseinfo.form.description.placeholder") })
.trim()
.min(0, t("workflow.baseinfo.form.description.placeholder"))
.max(256, t("common.errmsg.string_max", { max: 256 }))
.trim()
.nullish(),
});
const formRule = createSchemaFieldRule(formSchema);