mirror of
https://github.com/langgenius/dify.git
synced 2026-05-10 14:14:17 +08:00
refactor: import SandboxProvider type from @/types and remove retry:0
Move type imports to @/types/sandbox-provider instead of re-exporting from service file. Remove unnecessary retry:0 options to use React Query's default retry behavior.
This commit is contained in:
parent
3b78f9c2a5
commit
2279b605c6
@ -1,7 +1,7 @@
|
||||
'use client'
|
||||
|
||||
import type { FormRefObject, FormSchema } from '@/app/components/base/form/types'
|
||||
import type { SandboxProvider } from '@/service/use-sandbox-provider'
|
||||
import type { SandboxProvider } from '@/types/sandbox-provider'
|
||||
import { RiExternalLinkLine, RiLock2Fill } from '@remixicon/react'
|
||||
import { memo, useCallback, useMemo, useRef } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import type { SandboxProvider } from '@/service/use-sandbox-provider'
|
||||
import type { SandboxProvider } from '@/types/sandbox-provider'
|
||||
import { memo, useState } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import Loading from '@/app/components/base/loading'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import type { SandboxProvider } from '@/service/use-sandbox-provider'
|
||||
import type { SandboxProvider } from '@/types/sandbox-provider'
|
||||
import { RiEqualizer2Line } from '@remixicon/react'
|
||||
import { memo } from 'react'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
'use client'
|
||||
|
||||
import type { SandboxProvider } from '@/service/use-sandbox-provider'
|
||||
import type { SandboxProvider } from '@/types/sandbox-provider'
|
||||
import { memo, useCallback } from 'react'
|
||||
import { Trans, useTranslation } from 'react-i18next'
|
||||
import Button from '@/app/components/base/button'
|
||||
|
||||
@ -5,13 +5,10 @@ import {
|
||||
} from '@tanstack/react-query'
|
||||
import { consoleClient, consoleQuery } from '@/service/client'
|
||||
|
||||
export type { ConfigSchema, SandboxProvider } from '@/types/sandbox-provider'
|
||||
|
||||
export const useGetSandboxProviderList = () => {
|
||||
return useQuery({
|
||||
queryKey: consoleQuery.getSandboxProviderList.queryKey(),
|
||||
queryFn: () => consoleClient.getSandboxProviderList(),
|
||||
retry: 0,
|
||||
})
|
||||
}
|
||||
|
||||
@ -19,7 +16,6 @@ export const useGetSandboxProvider = (providerType: string) => {
|
||||
return useQuery({
|
||||
queryKey: consoleQuery.getSandboxProvider.queryKey({ input: { params: { providerType } } }),
|
||||
queryFn: () => consoleClient.getSandboxProvider({ params: { providerType } }),
|
||||
retry: 0,
|
||||
enabled: !!providerType,
|
||||
})
|
||||
}
|
||||
@ -74,6 +70,5 @@ export const useGetActiveSandboxProvider = () => {
|
||||
return useQuery({
|
||||
queryKey: consoleQuery.getActiveSandboxProvider.queryKey(),
|
||||
queryFn: () => consoleClient.getActiveSandboxProvider(),
|
||||
retry: 0,
|
||||
})
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user