Fix: Resolve TypeScript error with analysis_mode field in AnalysisForm

- Changed analysis_mode schema from .default() to .optional().default()
- This fixes the type mismatch error in the resolver with zodResolver
- Allows the form to properly infer the field as optional with a default value
This commit is contained in:
MarkLo127 2026-03-12 21:54:34 +08:00
parent dfa723a23a
commit 271175bb4d
1 changed files with 1 additions and 1 deletions

View File

@ -52,7 +52,7 @@ const formSchema = z.object({
.regex(/^\d{4}-\d{2}-\d{2}$/, "日期格式必須為 YYYY-MM-DD"),
analysts: z.array(z.string()).min(1, "請至少選擇一位分析師"),
research_depth: z.number().int().min(1).max(5),
analysis_mode: z.enum(["fast", "deep"]).default("deep"),
analysis_mode: z.enum(["fast", "deep"]).optional().default("deep"),
quick_think_llm: z.string().min(1, "請選擇快速思維模型"),
deep_think_llm: z.string().min(1, "請選擇深層思維模型"),
embedding_model: z.string().min(1, "請選擇嵌入式模型"),