big restructure
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
use MintyPHP\Http\Request;
|
||||
use MintyPHP\Router;
|
||||
use MintyPHP\Session;
|
||||
use MintyPHP\Service\UserService;
|
||||
use MintyPHP\Service\User\UserService;
|
||||
use MintyPHP\Support\Guard;
|
||||
|
||||
Guard::requireLogin();
|
||||
@@ -34,8 +34,9 @@ if ($userId <= 0) {
|
||||
return;
|
||||
}
|
||||
|
||||
$theme = trim((string) ($_POST['theme'] ?? ''));
|
||||
if (!in_array($theme, ['light', 'dark'], true)) {
|
||||
$theme = strtolower(trim((string) ($_POST['theme'] ?? '')));
|
||||
$themes = appThemes();
|
||||
if ($theme === '' || !isset($themes[$theme])) {
|
||||
http_response_code(400);
|
||||
if (Request::wantsJson()) {
|
||||
Router::json(['ok' => false, 'error' => 'invalid_theme']);
|
||||
|
||||
Reference in New Issue
Block a user