chore: refactor tool loading logic to improve shared tool handling
--bug=1060756 --user=刘瑞斌 【应用】AI对话节点的工具,无法获取共享工具 https://www.tapd.cn/62980211/s/1760222v3.2
parent
72fd741fbc
commit
925cedec28
|
|
@ -196,13 +196,17 @@ function getList() {
|
||||||
const folder_id = currentFolder.value?.id || user.getWorkspaceId()
|
const folder_id = currentFolder.value?.id || user.getWorkspaceId()
|
||||||
loadSharedApi({
|
loadSharedApi({
|
||||||
type: 'tool',
|
type: 'tool',
|
||||||
systemType: apiType.value,
|
isShared: folder_id === 'share',
|
||||||
|
systemType: 'workspace',
|
||||||
|
}).getToolList({
|
||||||
|
folder_id: folder_id,
|
||||||
|
tool_type: 'CUSTOM'
|
||||||
|
}).then((res: any) => {
|
||||||
|
toolList.value = res.data?.tools || res.data || []
|
||||||
|
toolList.value = toolList.value?.filter((item: any) => item.is_active)
|
||||||
|
searchData.value = res.data.tools || res.data
|
||||||
|
searchData.value = searchData.value?.filter((item: any) => item.is_active)
|
||||||
})
|
})
|
||||||
.getToolList({ folder_id }, apiLoading)
|
|
||||||
.then((res: any) => {
|
|
||||||
toolList.value = uniqueArray([...toolList.value, ...res.data.tools], 'id')
|
|
||||||
searchData.value = res.data.tools
|
|
||||||
})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
defineExpose({ open })
|
defineExpose({ open })
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue