(categoryId: string)
| 51 | } |
| 52 | } |
| 53 | async function handleDeleteCategory(categoryId: string) { |
| 54 | toast({ |
| 55 | title: "Deleting category", |
| 56 | }); |
| 57 | try { |
| 58 | await deleteCategory(categoryId); |
| 59 | router.refresh(); |
| 60 | toast({ |
| 61 | title: "Category deleted", |
| 62 | }); |
| 63 | } catch (error) { |
| 64 | toast({ |
| 65 | title: "Error deleting category", |
| 66 | }); |
| 67 | } |
| 68 | } |
| 69 | return ( |
| 70 | <Dialog> |
| 71 | <DialogTrigger asChild> |
no test coverage detected