mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-06-16 13:34:04 +08:00
refactor(provider): unify validation errors to use toast notifications
Change template parameter validation from form.setError to toast.error for consistent UX across all required field validations.
This commit is contained in:
@@ -389,13 +389,12 @@ export function ProviderForm({
|
||||
if (appId === "claude" && templateValueEntries.length > 0) {
|
||||
const validation = validateTemplateValues();
|
||||
if (!validation.isValid && validation.missingField) {
|
||||
form.setError("settingsConfig", {
|
||||
type: "manual",
|
||||
message: t("providerForm.fillParameter", {
|
||||
toast.error(
|
||||
t("providerForm.fillParameter", {
|
||||
label: validation.missingField.label,
|
||||
defaultValue: `请填写 ${validation.missingField.label}`,
|
||||
}),
|
||||
});
|
||||
);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user