Fix twofaccounts count missing in groups listing & Active group saving

This commit is contained in:
Bubka 2023-02-25 22:24:44 +01:00
parent c8c1530b51
commit 1788887f85
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ class GroupController extends Controller
*/ */
public function index(Request $request) public function index(Request $request)
{ {
$groups = Groups::prependTheAllGroup($request->user()->groups, $request->user()->id); $groups = Groups::prependTheAllGroup($request->user()->groups()->withCount('twofaccounts')->get(), $request->user()->id);
return GroupResource::collection($groups); return GroupResource::collection($groups);
} }

View File

@ -545,7 +545,7 @@
// In db saving if the user set 2FAuth to memorize the active group // In db saving if the user set 2FAuth to memorize the active group
if( this.$root.userPreferences.rememberActiveGroup ) { if( this.$root.userPreferences.rememberActiveGroup ) {
this.form.put('/api/v1/settings/activeGroup', {returnError: true}) this.form.put('/api/v1/user/preferences/activeGroup', {returnError: true})
.then(response => { .then(response => {
// everything's fine // everything's fine
}) })