Skip to content

armgit / dify

Public Imported from GitHub
0

Build Agentic workflows, RAG pipelines, with rich AI model and tool support on one collaborative workspace. Deploy on cloud, VPC, or self-hosted, so teams move from prototype to production without rebuilding the stack.

712 B
Raw Blame
import { useQuery } from '@tanstack/react-query'
import { getMarketplaceApiUrl } from '@/features/marketplace/api'
import { marketplaceQuery } from '@/service/marketplace'

export const useMarketplaceTemplateDetail = (templateId: string | null) => {
  return useQuery({
    ...marketplaceQuery.templateDetail.queryOptions({
      input: { params: { templateId: templateId ?? '' } },
    }),
    enabled: !!templateId,
  })
}

export const fetchMarketplaceTemplateDSL = async (templateId: string): Promise<string> => {
  const response = await fetch(getMarketplaceApiUrl(`templates/${templateId}/dsl`))
  if (!response.ok) throw new Error(`Failed to fetch DSL: ${response.statusText}`)
  return response.text()
}