Fixed bad translation string

Signed-off-by: snipe <snipe@snipe.net>
This commit is contained in:
snipe 2024-05-28 15:21:28 +01:00
parent 33d5d5e24f
commit 03b5c2e246

View file

@ -62,13 +62,16 @@ class GroupsController extends Controller
{
$this->authorize('superadmin');
$group = new Group;
// Get all the available permissions
$permissions = config('permissions');
$groupPermissions = Helper::selectedPermissionsArray($permissions, $permissions);
$group->name = $request->input('name');
$group->created_by = Auth::user()->id;
$group->permissions = json_encode($request->input('permissions')); // Todo - some JSON validation stuff here
$group->permissions = $request->input('permissions', $groupPermissions);
if ($group->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $group, trans('admin/groups/message.create.success')));
return response()->json(Helper::formatStandardApiResponse('success', (new GroupsTransformer)->transformGroup($group), trans('admin/groups/message.success.create')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $group->getErrors()));
@ -86,7 +89,6 @@ class GroupsController extends Controller
{
$this->authorize('superadmin');
$group = Group::findOrFail($id);
return (new GroupsTransformer)->transformGroup($group);
}
@ -108,7 +110,7 @@ class GroupsController extends Controller
$group->permissions = $request->input('permissions'); // Todo - some JSON validation stuff here
if ($group->save()) {
return response()->json(Helper::formatStandardApiResponse('success', $group, trans('admin/groups/message.update.success')));
return response()->json(Helper::formatStandardApiResponse('success', (new GroupsTransformer)->transformGroup($group), trans('admin/groups/message.success.update')));
}
return response()->json(Helper::formatStandardApiResponse('error', null, $group->getErrors()));