mirror of
https://github.com/openclassify/openclassify.git
synced 2026-01-11 18:01:10 -06:00
#173 fixed
This commit is contained in:
parent
55a35422ad
commit
95e97a3ede
@ -66,12 +66,6 @@ class CategoryRepository extends EntryRepository implements CategoryRepositoryIn
|
||||
|
||||
public function DeleteCategories($id)
|
||||
{
|
||||
$sub_categories = $this->model->getAllSubCategories($id);
|
||||
if (count($sub_categories)) {
|
||||
$this->model
|
||||
->whereIn('id', array_merge($sub_categories, [$id]))
|
||||
->delete();
|
||||
} else
|
||||
$this->model->find($id)->delete();
|
||||
$this->model->find($id)->delete();
|
||||
}
|
||||
}
|
||||
|
||||
@ -225,18 +225,7 @@ class CategoryController extends AdminController
|
||||
|
||||
public function delete(CategoryRepositoryInterface $categoryRepository, Request $request, CategoryModel $categoryModel, $id)
|
||||
{
|
||||
ini_set('max_execution_time', 0);
|
||||
echo "<div style='background-image:url(" . $this->dispatch(new MakeImageInstance('visiosoft.theme.base::images/loading_anim.gif', 'img'))->url() . ");
|
||||
background-repeat:no-repeat;
|
||||
background-size: 300px;
|
||||
background-position:center;
|
||||
text-align:center;
|
||||
width:98%;
|
||||
height:100%;
|
||||
padding-left: 20px;'><h3>" . trans('visiosoft.module.cats::field.please_wait') . "</h3></div>";
|
||||
|
||||
$categoryRepository->DeleteCategories($id);
|
||||
|
||||
if ($request->parent == "")
|
||||
return redirect('admin/cats')->with('success', ['Category and related sub-categories deleted successfully.']);
|
||||
else
|
||||
|
||||
Loading…
Reference in New Issue
Block a user