Timothy J. Baek 1 rok temu
rodzic
commit
91bc65c7da

+ 2 - 1
backend/apps/webui/routers/tools.py

@@ -172,6 +172,7 @@ async def delete_toolkit_by_id(request: Request, id: str, user=Depends(get_admin
 
     if result:
         TOOLS = request.app.state.TOOLS
-        del TOOLS[id]
+        if id in TOOLS:
+            del TOOLS[id]
 
     return result

+ 3 - 1
src/lib/components/workspace/Tools.svelte

@@ -166,7 +166,9 @@
 				<button
 					class="self-center w-fit text-sm px-2 py-2 dark:text-gray-300 dark:hover:text-white hover:bg-black/5 dark:hover:bg-white/5 rounded-xl"
 					type="button"
-					on:click={async () => {
+					on:click={async (e) => {
+						e.stopPropagation();
+
 						const res = await deleteToolById(localStorage.token, tool.id).catch((error) => {
 							toast.error(error);
 							return null;