mirror of
https://github.com/MetaCubeX/metacubexd.git
synced 2024-11-10 05:15:35 +08:00
feat(config): toast error message when dns query failed for some reason, closes #321
This commit is contained in:
parent
fd235311d8
commit
82c2772afe
@ -9,6 +9,7 @@ import {
|
||||
createSignal,
|
||||
onMount,
|
||||
} from 'solid-js'
|
||||
import { toast } from 'solid-toast'
|
||||
import { z } from 'zod'
|
||||
import {
|
||||
fetchBackendConfigAPI,
|
||||
@ -56,7 +57,7 @@ const DNSQueryForm = () => {
|
||||
const { form, isSubmitting } = createForm<z.infer<typeof dnsQueryFormSchema>>(
|
||||
{
|
||||
extend: validator({ schema: dnsQueryFormSchema }),
|
||||
onSubmit: async (values) => {
|
||||
onSubmit: (values) =>
|
||||
request
|
||||
.get('dns/query', {
|
||||
searchParams: { name: values.name, type: values.type },
|
||||
@ -65,7 +66,7 @@ const DNSQueryForm = () => {
|
||||
.then(({ Answer }) =>
|
||||
setDNSQueryResult(Answer?.map(({ data }) => data) || []),
|
||||
)
|
||||
},
|
||||
.catch((err) => toast.error(err.message)),
|
||||
},
|
||||
)
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user