Explorar o código

Move TwoFAccounts order saving to business service

Bubka %!s(int64=3) %!d(string=hai) anos
pai
achega
59a63f5a2a

+ 1 - 1
app/Http/Controllers/TwoFAccountController.php

@@ -132,7 +132,7 @@ class TwoFAccountController extends Controller
     {
         $validated = $request->validated();
 
-        TwoFAccount::setNewOrder($validated['orderedIds']);
+        $this->twofaccountService->saveOrder($validated['orderedIds']);
 
         return response()->json(['message' => 'order saved'], 200);
     }

+ 8 - 0
app/Services/TwoFAccountService.php

@@ -179,6 +179,14 @@ class TwoFAccountService
     }
 
 
+    /**
+     * Save TwoFAccounts order
+     */
+    public function saveOrder(array $ids)
+    {
+        TwoFAccount::setNewOrder($ids);
+    }
+
 
 // ########################################################################################################################
 // ########################################################################################################################