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

Function handleUpdate

components/admin/category-manager.tsx:58–68  ·  view source on GitHub ↗
(_: ActionState | null, formData: FormData)

Source from the content-addressed store, hash-verified

56 };
57
58 const handleUpdate = async (_: ActionState | null, formData: FormData) => {
59 const payload = {
60 id: selectedCategory?.id as string,
61 name: formData.get("name") as string,
62 description: formData.get("description") as string,
63 slug: formData.get("slug") as string,
64 color: formData.get("color") as string,
65 icon: formData.get("icon") as string,
66 };
67 return updateCategory(null, payload);
68 };
69
70 const handleDelete = async (_: ActionState | null, formData: FormData) => {
71 return deleteCategory(null, { id: formData.get("id") as string });

Callers

nothing calls this directly

Calls 1

updateCategoryFunction · 0.90

Tested by

no test coverage detected