fix: callback function condition

This commit is contained in:
hexastack 2024-10-07 15:48:54 +01:00
parent 5576b151a8
commit d7edfdf384

View File

@ -135,12 +135,14 @@ export const Categories = () => {
<DeleteDialog
{...deleteDialogCtl}
callback={async () => {
if (selectedCategories.length > 0) {
deleteCategories(selectedCategories), setSelectedCategories([]);
deleteDialogCtl.closeDialog();
}
if (deleteDialogCtl?.data) {
if (selectedCategories.length > 0) {
deleteCategories(selectedCategories), setSelectedCategories([]);
deleteDialogCtl.closeDialog();
} else {
{
deleteCategory(deleteDialogCtl.data);
deleteDialogCtl.closeDialog();
}
}
}}