instances added god may help
This commit is contained in:
@@ -2,12 +2,13 @@
|
||||
|
||||
use MintyPHP\Http\Request;
|
||||
use MintyPHP\Router;
|
||||
use MintyPHP\Service\User\UserServicesFactory;
|
||||
use MintyPHP\Session;
|
||||
use MintyPHP\Service\User\UserService;
|
||||
use MintyPHP\Support\Guard;
|
||||
use MintyPHP\Support\Flash;
|
||||
use MintyPHP\Support\Guard;
|
||||
|
||||
Guard::requireLogin();
|
||||
$userAccountService = (new UserServicesFactory())->createUserAccountService();
|
||||
|
||||
if (($_SERVER['REQUEST_METHOD'] ?? 'GET') !== 'POST') {
|
||||
Router::redirect('admin');
|
||||
@@ -58,7 +59,7 @@ if ($theme === '' || !isset($themes[$theme])) {
|
||||
return;
|
||||
}
|
||||
|
||||
$updated = UserService::setTheme($userId, $theme);
|
||||
$updated = $userAccountService->setTheme($userId, $theme);
|
||||
if (!$updated) {
|
||||
http_response_code(500);
|
||||
if (Request::wantsJson()) {
|
||||
|
||||
Reference in New Issue
Block a user