refactor: simplify plugin task handling and improve UI feedback (#26293)

This commit is contained in:
GuanMu
2025-12-10 13:34:05 +08:00
committed by GitHub
parent 681c06186e
commit 0867c1800b
5 changed files with 201 additions and 99 deletions

View File

@ -634,7 +634,8 @@ export const usePluginTaskList = (category?: PluginCategoryEnum | string) => {
export const useMutationClearTaskPlugin = () => {
return useMutation({
mutationFn: ({ taskId, pluginId }: { taskId: string; pluginId: string }) => {
return post<{ success: boolean }>(`/workspaces/current/plugin/tasks/${taskId}/delete/${pluginId}`)
const encodedPluginId = encodeURIComponent(pluginId)
return post<{ success: boolean }>(`/workspaces/current/plugin/tasks/${taskId}/delete/${encodedPluginId}`)
},
})
}