feat: download package

This commit is contained in:
Joel
2024-11-21 14:24:43 +08:00
parent b01c18ae7f
commit 11ed86f2a8
5 changed files with 48 additions and 3 deletions

View File

@ -344,3 +344,12 @@ export const useMutationCheckDependenciesBeforeImportDSL = () => {
return mutation
}
export const useDownloadPlugin = (info: { organization: string; pluginName: string; version: string }, needDownload: boolean) => {
return useQuery({
queryKey: [NAME_SPACE, 'downloadPlugin', info],
queryFn: () => getMarketplace<Blob>(`/plugins/${info.organization}/${info.pluginName}/${info.version}/download`),
enabled: needDownload,
retry: 0,
})
}