Fix: Fixed the issue where clicking the SQL tool test button did not request the interface #9541 (#9542)

### What problem does this PR solve?

Fix: Fixed the issue where clicking the SQL tool test button did not
request the interface #9541
### Type of change

- [x] Bug Fix (non-breaking change which fixes an issue)
This commit is contained in:
balibabu
2025-08-19 16:41:32 +08:00
committed by GitHub
parent 787e0c6786
commit a41a646909
14 changed files with 268 additions and 84 deletions

View File

@ -3,7 +3,6 @@ import { useCallback } from 'react';
import { z } from 'zod';
export const ExeSQLFormSchema = {
sql: z.string(),
db_type: z.string().min(1),
database: z.string().min(1),
username: z.string().min(1),
@ -14,7 +13,7 @@ export const ExeSQLFormSchema = {
};
export const FormSchema = z.object({
query: z.string().optional(),
sql: z.string().optional(),
...ExeSQLFormSchema,
});

View File

@ -25,11 +25,13 @@ const ExeSQLForm = () => {
defaultValues: defaultValues as FormType,
});
const onError = (error: any) => console.log(error);
useWatchFormChange(form);
return (
<Form {...form}>
<FormWrapper onSubmit={form.handleSubmit(onSubmit)}>
<FormWrapper onSubmit={form.handleSubmit(onSubmit, onError)}>
<ExeSQLFormWidgets loading={loading}></ExeSQLFormWidgets>
</FormWrapper>
</Form>