MCPcopy Create free account
hub / github.com/9d8dev/directory / handleDelete

Function handleDelete

components/admin/bookmark-manager.tsx:249–272  ·  view source on GitHub ↗
(bookmark: BookmarkWithCategory)

Source from the content-addressed store, hash-verified

247 };
248
249 const handleDelete = async (bookmark: BookmarkWithCategory) => {
250 setIsDeleting(true);
251 setBookmarkToDelete(bookmark);
252
253 try {
254 const deleteData = {
255 id: bookmark.id.toString(),
256 url: bookmark.url,
257 };
258 const result = await deleteBookmark(null, deleteData);
259
260 if (result.success) {
261 toast.success("Bookmark deleted!");
262 setBookmarkToDelete(null);
263 } else {
264 toast.error(result.error || "Failed to delete bookmark");
265 }
266 } catch (err) {
267 console.error("Error deleting bookmark:", err);
268 toast.error("Failed to delete bookmark");
269 } finally {
270 setIsDeleting(false);
271 }
272 };
273
274 const handleTitleChange = (e: React.ChangeEvent<HTMLInputElement>) => {
275 const title = e.target.value;

Callers 1

BookmarkManagerFunction · 0.70

Calls 1

deleteBookmarkFunction · 0.90

Tested by

no test coverage detected