MCPcopy Create free account
hub / github.com/Microck/opencode-studio / handleDelete

Function handleDelete

client-next/src/app/plugins/page.tsx:51–65  ·  view source on GitHub ↗
(name: string, type: 'file' | 'npm')

Source from the content-addressed store, hash-verified

49 };
50
51 const handleDelete = async (name: string, type: 'file' | 'npm') => {
52 if (!confirm(`Delete ${name}?`)) return;
53 try {
54 if (type === 'npm') {
55 await deletePluginFromConfig(name);
56 } else {
57 await deletePlugin(name);
58 }
59 toast.success(`${name} deleted`);
60 refreshData();
61 } catch (err: any) {
62 const msg = err.response?.data?.error || err.message || "Unknown error";
63 toast.error(`Failed to delete plugin: ${msg}`);
64 }
65 };
66
67 if (loading) {
68 return (

Callers 1

PluginsPageFunction · 0.70

Calls 2

deletePluginFromConfigFunction · 0.90
deletePluginFunction · 0.90

Tested by

no test coverage detected