Selaa lähdekoodia

Move group->loadCount from the Assign void method to the caller

Bubka 5 kuukautta sitten
vanhempi
commit
19f3a71c03
2 muutettua tiedostoa jossa 1 lisäystä ja 2 poistoa
  1. 1 0
      app/Api/v1/Controllers/GroupController.php
  2. 0 2
      app/Services/GroupService.php

+ 1 - 0
app/Api/v1/Controllers/GroupController.php

@@ -104,6 +104,7 @@ class GroupController extends Controller
 
         try {
             Groups::assign($validated['ids'], $request->user(), $group);
+            $group->loadCount('twofaccounts');
         } catch (ModelNotFoundException $exc) {
             abort(404);
         }

+ 0 - 2
app/Services/GroupService.php

@@ -74,8 +74,6 @@ class GroupService
     
                 Log::info(sprintf('Twofaccounts #%s assigned to group %s (ID #%s)', implode(',', $ids), var_export($group->name, true), $group->id));
             });
-
-            $group->loadCount('twofaccounts');
         } else {
             Log::info('Cannot find a group to assign the TwoFAccounts to');
         }