dify/web/service/use-common.ts
2024-11-15 10:43:21 +08:00

15 lines
388 B
TypeScript

import { get } from './base'
import type {
FileUploadConfigResponse,
} from '@/models/common'
import { useQuery } from '@tanstack/react-query'
const NAME_SPACE = 'common'
export const useFileUploadConfig = () => {
return useQuery<FileUploadConfigResponse>({
queryKey: [NAME_SPACE, 'file-upload-config'],
queryFn: () => get<FileUploadConfigResponse>('/files/upload'),
})
}