mirror of
https://github.com/openclassify/openclassify.git
synced 2026-02-09 06:46:08 -06:00
commit
c90cfbc453
@ -181,10 +181,12 @@ class CategoryController extends AdminController
|
|||||||
public function delete(CategoryRepositoryInterface $categoryRepository, Request $request, CategoryModel $categoryModel, $id)
|
public function delete(CategoryRepositoryInterface $categoryRepository, Request $request, CategoryModel $categoryModel, $id)
|
||||||
{
|
{
|
||||||
$categoryRepository->DeleteCategories($id);
|
$categoryRepository->DeleteCategories($id);
|
||||||
if ($request->parent == "")
|
$subCats = $categoryRepository->getSubCatById($request->parent);
|
||||||
return redirect('admin/cats')->with('success', ['Category and related sub-categories deleted successfully.']);
|
if (count($subCats)) {
|
||||||
else
|
|
||||||
return redirect('admin/cats?cat=' . $request->parent)->with('success', ['Category and related sub-categories deleted successfully.']);
|
return redirect('admin/cats?cat=' . $request->parent)->with('success', ['Category and related sub-categories deleted successfully.']);
|
||||||
|
} else {
|
||||||
|
return redirect('admin/cats')->with('success', ['Category and related sub-categories deleted successfully.']);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function cleanSubcats()
|
public function cleanSubcats()
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user