Skip to content

Commit c987306

Browse files
committed
fix(dashboard): Add ability to delete option groups from products
1 parent 937507b commit c987306

1 file changed

Lines changed: 22 additions & 0 deletions

File tree

packages/dashboard/src/app/routes/_authenticated/_products/products_.$id_.variants.tsx

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -308,6 +308,28 @@ function ManageProductVariants() {
308308
/>
309309
</div>
310310
</div>
311+
<div className="col-span-1 flex justify-end">
312+
<Button
313+
size="icon"
314+
variant="ghost"
315+
onClick={() => {
316+
if (confirm(t`Are you sure you want to remove this option group? This will affect all variants using this option.`)) {
317+
removeOptionGroupMutation.mutate(
318+
{ productId: id, optionGroupId: group.id },
319+
{
320+
onError: (error) => {
321+
toast.error(t`Failed to remove option group`, {
322+
description: error instanceof Error ? error.message : t`Unknown error`,
323+
});
324+
}
325+
}
326+
);
327+
}
328+
}}
329+
>
330+
<Trash2 className="h-4 w-4 text-destructive" />
331+
</Button>
332+
</div>
311333
</div>
312334
))
313335
)}

0 commit comments

Comments
 (0)