fix: format BotForm.tsx with prettier

This commit is contained in:
Typer_Body
2026-04-02 01:38:21 +08:00
parent ac337b31df
commit eb633f8849

View File

@@ -13,7 +13,11 @@ import { IDynamicFormItemSchema } from '@/app/infra/entities/form/dynamic';
import { UUID } from 'uuidjs'; import { UUID } from 'uuidjs';
import DynamicFormComponent from '@/app/home/components/dynamic-form/DynamicFormComponent'; import DynamicFormComponent from '@/app/home/components/dynamic-form/DynamicFormComponent';
import { httpClient } from '@/app/infra/http/HttpClient'; import { httpClient } from '@/app/infra/http/HttpClient';
import { Bot, PipelineRoutingRule, RoutingRuleOperator } from '@/app/infra/entities/api'; import {
Bot,
PipelineRoutingRule,
RoutingRuleOperator,
} from '@/app/infra/entities/api';
import { getAdapterDocUrl } from '@/app/infra/entities/adapter-docs'; import { getAdapterDocUrl } from '@/app/infra/entities/adapter-docs';
import { ExternalLink, Plus, Trash2 } from 'lucide-react'; import { ExternalLink, Plus, Trash2 } from 'lucide-react';
@@ -586,8 +590,7 @@ export default function BotForm({
...(form.getValues('pipeline_routing_rules') || ...(form.getValues('pipeline_routing_rules') ||
[]), []),
]; ];
const newType = const newType = val as PipelineRoutingRule['type'];
val as PipelineRoutingRule['type'];
// Reset operator to 'eq' when switching type // Reset operator to 'eq' when switching type
rules[index] = { rules[index] = {
...rules[index], ...rules[index],
@@ -651,9 +654,8 @@ export default function BotForm({
value={rule.value} value={rule.value}
onValueChange={(val) => { onValueChange={(val) => {
const rules = [ const rules = [
...(form.getValues( ...(form.getValues('pipeline_routing_rules') ||
'pipeline_routing_rules', []),
) || []),
]; ];
rules[index] = { ...rules[index], value: val }; rules[index] = { ...rules[index], value: val };
form.setValue('pipeline_routing_rules', rules, { form.setValue('pipeline_routing_rules', rules, {
@@ -688,9 +690,8 @@ export default function BotForm({
value={rule.value} value={rule.value}
onChange={(e) => { onChange={(e) => {
const rules = [ const rules = [
...(form.getValues( ...(form.getValues('pipeline_routing_rules') ||
'pipeline_routing_rules', []),
) || []),
]; ];
rules[index] = { rules[index] = {
...rules[index], ...rules[index],