feat(frontend): workflow import dsl from url (#6286)

This commit is contained in:
zxhlyh
2024-07-15 16:24:03 +08:00
committed by GitHub
parent 46a5294d94
commit 9a536979ab
6 changed files with 158 additions and 25 deletions

View File

@@ -37,6 +37,10 @@ export const importApp: Fetcher<AppDetailResponse, { data: string; name?: string
return post<AppDetailResponse>('apps/import', { body: { data, name, description, icon, icon_background } })
}
export const importAppFromUrl: Fetcher<AppDetailResponse, { url: string; name?: string; description?: string; icon?: string; icon_background?: string }> = ({ url, name, description, icon, icon_background }) => {
return post<AppDetailResponse>('apps/import/url', { body: { url, name, description, icon, icon_background } })
}
export const switchApp: Fetcher<{ new_app_id: string }, { appID: string; name: string; icon: string; icon_background: string }> = ({ appID, name, icon, icon_background }) => {
return post<{ new_app_id: string }>(`apps/${appID}/convert-to-workflow`, { body: { name, icon, icon_background } })
}