Skip to content

Commit 925cede

Browse files
committed
chore: refactor tool loading logic to improve shared tool handling
--bug=1060756 --user=刘瑞斌 【应用】AI对话节点的工具,无法获取共享工具 https://www.tapd.cn/62980211/s/1760222
1 parent 72fd741 commit 925cede

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

ui/src/views/application/component/ToolDialog.vue

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,13 +196,17 @@ function getList() {
196196
const folder_id = currentFolder.value?.id || user.getWorkspaceId()
197197
loadSharedApi({
198198
type: 'tool',
199-
systemType: apiType.value,
199+
isShared: folder_id === 'share',
200+
systemType: 'workspace',
201+
}).getToolList({
202+
folder_id: folder_id,
203+
tool_type: 'CUSTOM'
204+
}).then((res: any) => {
205+
toolList.value = res.data?.tools || res.data || []
206+
toolList.value = toolList.value?.filter((item: any) => item.is_active)
207+
searchData.value = res.data.tools || res.data
208+
searchData.value = searchData.value?.filter((item: any) => item.is_active)
200209
})
201-
.getToolList({ folder_id }, apiLoading)
202-
.then((res: any) => {
203-
toolList.value = uniqueArray([...toolList.value, ...res.data.tools], 'id')
204-
searchData.value = res.data.tools
205-
})
206210
}
207211
208212
defineExpose({ open })

0 commit comments

Comments
 (0)