mirror of
https://github.com/langgenius/dify.git
synced 2026-01-28 22:53:23 +08:00
24 lines
572 B
TypeScript
24 lines
572 B
TypeScript
import { useQuery } from '@tanstack/react-query'
|
|
import { fetchTryAppInfo } from './try-app'
|
|
import { AppSourceType, fetchAppParams } from './share'
|
|
|
|
const NAME_SPACE = 'try-app'
|
|
|
|
export const useGetTryAppInfo = (appId: string) => {
|
|
return useQuery({
|
|
queryKey: [NAME_SPACE, 'appInfo'],
|
|
queryFn: () => {
|
|
return fetchTryAppInfo(appId)
|
|
},
|
|
})
|
|
}
|
|
|
|
export const useGetTryAppParams = (appId: string) => {
|
|
return useQuery({
|
|
queryKey: [NAME_SPACE, 'appParams'],
|
|
queryFn: () => {
|
|
return fetchAppParams(AppSourceType.tryApp, appId)
|
|
},
|
|
})
|
|
}
|