Fixed incorrect group route

This commit is contained in:
snipe 2019-01-24 15:17:11 -08:00
parent 39bca49e8f
commit 8f09cca043

View file

@ -72,7 +72,7 @@ class GroupsController extends Controller
if ($group->save()) { if ($group->save()) {
return redirect()->route("groups.index")->with('success', trans('admin/groups/message.success.create')); return redirect()->route("groups.index")->with('success', trans('admin/groups/message.success.create'));
} }
return redirect(route('groups.create'))->withInput()->withErrors($group->getErrors()); return redirect()->back()->withInput()->withErrors($group->getErrors());
} }
/** /**
@ -111,7 +111,7 @@ class GroupsController extends Controller
{ {
$permissions = config('permissions'); $permissions = config('permissions');
if (!$group = Group::find($id)) { if (!$group = Group::find($id)) {
return redirect()->route('groups')->with('error', trans('admin/groups/message.group_not_found', compact('id'))); return redirect()->route('groups.index')->with('error', trans('admin/groups/message.group_not_found', compact('id')));
} }
$group->name = e(Input::get('name')); $group->name = e(Input::get('name'));
$group->permissions = json_encode(Input::get('permission')); $group->permissions = json_encode(Input::get('permission'));
@ -138,7 +138,7 @@ class GroupsController extends Controller
{ {
if (!config('app.lock_passwords')) { if (!config('app.lock_passwords')) {
if (!$group = Group::find($id)) { if (!$group = Group::find($id)) {
return redirect()->route('groups')->with('error', trans('admin/groups/message.group_not_found', compact('id'))); return redirect()->route('groups.index')->with('error', trans('admin/groups/message.group_not_found', compact('id')));
} }
$group->delete(); $group->delete();
// Redirect to the group management page // Redirect to the group management page