mirror of
https://github.com/langgenius/dify.git
synced 2026-07-21 10:38:32 +08:00
14 lines
647 B
TypeScript
14 lines
647 B
TypeScript
import type { LangGeniusVersionResponse } from '@/models/common'
|
|
import { queryOptions } from '@tanstack/react-query'
|
|
// eslint-disable-next-line no-restricted-imports
|
|
import { get } from './base'
|
|
import { commonQueryKeys } from './use-common'
|
|
|
|
export const langGeniusVersionQueryOptions = (currentVersion?: string | null, enabled?: boolean) => {
|
|
return queryOptions<LangGeniusVersionResponse>({
|
|
queryKey: commonQueryKeys.langGeniusVersion(currentVersion || undefined),
|
|
queryFn: () => get<LangGeniusVersionResponse>('/version', { params: { current_version: currentVersion } }),
|
|
enabled: !!currentVersion && (enabled ?? true),
|
|
})
|
|
}
|