Added comments

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2023-01-10 16:24:46 -08:00
parent 825df2cf75
commit 151719a91c

View file

@ -128,17 +128,15 @@ class CategoriesController extends Controller
$this->authorize('update', Category::class);
$category = Category::findOrFail($id);
if ($category->category_type !== $request->input('category_type')) {
// Don't allow the user to change the category_type once it's been created
if (($request->filled('category_type')) && ($category->category_type != $request->input('category_type'))) {
return response()->json(
Helper::formatStandardApiResponse('error', null, trans('admin/categories/message.update.cannot_change_category_type'))
);
}
$category->fill($request->all());
$category = $request->handleImages($category);
if ($category->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $category, trans('admin/categories/message.update.success')));
}