MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / handleDeleteTool

Function handleDeleteTool

frontend/src/components/drawerAssistant/index.tsx:183–207  ·  view source on GitHub ↗
(data: any,index:number)

Source from the content-addressed store, hash-verified

181 })
182 }
183 const handleDeleteTool = (data: any,index:number) => {
184 setPluginActionList((prev) => {
185 if(!data.value) {
186 prev.splice(index,1)
187 return [...prev];
188 }else {
189 const newPluginActionList = prev.filter(item => item.value !== data.value)
190 return newPluginActionList
191 }
192
193 })
194 if(data.type === 'action') {
195 setActionSelectedList((prev) => {
196 const newActionSelectedList = prev.filter(item => item.action_id !== data.value)
197 return newActionSelectedList
198 })
199 }
200 if(data.type === 'plugin') {
201 setSelectedPluginList((prev: any) => {
202 const newPluginSelectedList = prev.filter((item: any) => item !== data.value.split('/')[1])
203 return newPluginSelectedList
204 })
205 }
206
207 }
208 const handleAddTool = () => {
209 setPluginActionList((prev) => {
210 const newRetrievalFormList = [...prev, { type: 'plugin', value: '' }]

Callers 1

index.tsxFile · 0.85

Calls 1

filterMethod · 0.45

Tested by

no test coverage detected