User now can use test endpoints

This commit is contained in:
Pablo Ferreiro 2022-06-28 20:41:51 +02:00
parent 9acc40618a
commit bc3777d74c
No known key found for this signature in database
GPG key ID: 41FBCE65B779FA24
8 changed files with 48 additions and 24 deletions

View file

@ -12,11 +12,6 @@ class SettingsController {
$latte->render(Misc::getView('settings'), new BaseTemplate('Settings'));
}
static private function redirect() {
$url = Misc::url('/settings');
header("Location: {$url}");
}
static public function general() {
if (isset($_POST['theme'])) {
$theme = $_POST['theme'];
@ -26,6 +21,15 @@ class SettingsController {
}
static public function api() {
// TODO, ADD COUNT
if (isset($_POST['api-test_endpoints'])) {
$test_endpoints = $_POST['api-test_endpoints'];
Cookies::set('api-test_endpoints', $test_endpoints);
}
self::redirect();
}
static private function redirect() {
$url = Misc::url('/settings');
header("Location: {$url}");
}
}