Add tool duplication functionality and enhance ComponentsToolsPage
- Implement a new API endpoint for duplicating tools in the backend. - Add a duplicate_tool function in ComponentsToolsPage to handle tool duplication requests. - Update the UI to include a dropdown menu option for duplicating tools, improving user experience. - Refactor the remove function to accept a resource object instead of an ID for better clarity and maintainability.
This commit is contained in:
@@ -314,6 +314,8 @@ export const toolsApi = {
|
||||
}),
|
||||
remove: (id: string) =>
|
||||
request<{ ok: boolean }>(`/api/tools/${id}`, { method: "DELETE" }),
|
||||
duplicate: (id: string) =>
|
||||
request<Tool>(`/api/tools/${id}/duplicate`, { method: "POST" }),
|
||||
};
|
||||
|
||||
// ---------- 知识库 ----------
|
||||
|
||||
Reference in New Issue
Block a user