MCPcopy
hub / github.com/mudler/LocalAGI / handleCreate

Function handleCreate

webui/react-ui/src/pages/Knowledge.jsx:204–220  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

202 const [resetting, setResetting] = useState(null);
203
204 const handleCreate = async () => {
205 if (!newName.trim()) {
206 showToast('Enter a collection name', 'error');
207 return;
208 }
209 setCreating(true);
210 try {
211 await collectionsApi.create(newName.trim());
212 showToast(`Collection "${newName}" created`, 'success');
213 setNewName('');
214 onRefresh();
215 } catch (err) {
216 showToast(err.message || 'Failed to create collection', 'error');
217 } finally {
218 setCreating(false);
219 }
220 };
221
222 const handleReset = async (name) => {
223 if (!confirm(`Reset collection "${name}"? This removes all entries and cannot be undone.`)) return;

Callers 1

CollectionsTabFunction · 0.85

Calls 1

showToastFunction · 0.50

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…