dify/web/service/use-common.ts

15 lines
388 B
TypeScript
Raw Normal View History

2024-11-14 21:21:50 +08:00
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'),
})
}