mirror of
https://github.com/farion1231/cc-switch.git
synced 2026-07-31 02:51:21 +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) {
|
if (appId === "claude" && templateValueEntries.length > 0) {
|
||||||
const validation = validateTemplateValues();
|
const validation = validateTemplateValues();
|
||||||
if (!validation.isValid && validation.missingField) {
|
if (!validation.isValid && validation.missingField) {
|
||||||
form.setError("settingsConfig", {
|
toast.error(
|
||||||
type: "manual",
|
t("providerForm.fillParameter", {
|
||||||
message: t("providerForm.fillParameter", {
|
|
||||||
label: validation.missingField.label,
|
label: validation.missingField.label,
|
||||||
defaultValue: `请填写 ${validation.missingField.label}`,
|
defaultValue: `请填写 ${validation.missingField.label}`,
|
||||||
}),
|
}),
|
||||||
});
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user