Jake Vanderwerf
2026-08-27 f0645f805ecdd19cf5ed9842f9e6b69a86dbcdeb
inc/rest/routes/SettingsRoutes.php
@@ -1,6 +1,7 @@
<?php
namespace JVBase\rest\routes;
use JVBase\Instance;
use JVBase\JVB;
use JVBase\rest\PermissionHandler;
use JVBase\rest\Rest;
@@ -18,11 +19,13 @@
}
class SettingsRoutes extends Rest
{
   use Instance;
    protected int $count;
    public function __construct()
    {
        $this->cacheName = 'user_settings';
        parent::__construct();
      $this->cache = Cache::for($this->cacheName, null, $this->cacheTtl);
//        $this->action = 'dash-';
//        $this->operation_type = 'user_settings';
        $this->count = 1;
@@ -51,10 +54,9 @@
    {
        $data = $request->get_params();
      error_log('User: '.print_r($data['user'], true));
        error_log('Settings routes data: '.print_r($data, true));
        $user_id = absint($data['user']??0);
        if ($user_id === 0) {
        $user_id = get_current_user_id();
        if (!$user_id) {
            return $this->unauthorized();
        }
@@ -85,7 +87,7 @@
            $data['notification_preferences'] = $add;
        }
        JVB()->queue()->queueOperation(
        Queue::getInstance()->queueOperation(
            'user_settings',
            $user_id,
            $data,
@@ -145,8 +147,7 @@
            }
            $this->cache->flush();
        }
      $tempMeta->save();
      $meta->save();
        return [
            'success'   => true,
            'result'   => $results,