From bad59c66549eb601fed963ed013f9b79305ca003 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 07 Jan 2026 20:09:14 +0000
Subject: [PATCH] =Feedblock integrated with refactored taxonomy selector

---
 inc/rest/routes/SettingsRoutes.php |   17 ++++++-----------
 1 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/inc/rest/routes/SettingsRoutes.php b/inc/rest/routes/SettingsRoutes.php
index f02fad9..811984a 100644
--- a/inc/rest/routes/SettingsRoutes.php
+++ b/inc/rest/routes/SettingsRoutes.php
@@ -48,10 +48,9 @@
      */
     public function saveSettings(WP_REST_Request $request):WP_REST_Response
     {
-        $this->queue = JVB()->queue();
 
         $data = $request->get_params();
-
+		error_log('User: '.print_r($data['user'], true));
         error_log('Settings routes data: '.print_r($data, true));
         $user_id = (int)$data['user'];
         if (!$this->userCheck($user_id)) {
@@ -61,9 +60,8 @@
             ]);
         }
 
+		$this->queue = JVB()->queue();
 
-        $operation_id = $data['id'];
-        unset($data['id']);
 
         $fields = JVB()->getFields('user');
         $meta = new MetaSanitizer();
@@ -83,8 +81,7 @@
                 //Sanitize values
                 $data[$name] = $meta->sanitize($value, $fields[$name]);
                 if ($name === 'notify') {
-                    $cache = new CacheManager('usernames');
-                    $cache->invalidate($user_id);
+                    CacheManager::for('usernames')->delete($user_id);
                 }
             }
         }
@@ -93,12 +90,11 @@
         }
 
         $this->queue->queueOperation(
-            $this->type,
+            'user_settings',
             $user_id,
             $data,
             [
                 'count'   => 1,
-                'operation_id'      => $operation_id
             ]
         );
 
@@ -106,7 +102,6 @@
         return new WP_REST_Response([
             'success' =>true,
             'message' => 'Request received and queued',
-            'operation_id' => $operation_id,
             'status' => 'queued'
         ]);
     }
@@ -154,7 +149,7 @@
 				}
 
             }
-            CacheManager::invalidateGroup($this->cache_name);
+            CacheManager::for($this->cache_name)->invalidate();
         }
         return [
             'success'   => true,
@@ -223,7 +218,7 @@
             // Success - commit transaction
             $wpdb->query('COMMIT');
 
-            CacheManager::invalidateGroup($this->cache_name);
+            CacheManager::for($this->cache_name)->invalidate();
             return [
                 'success' => true,
                 'result' => 'Notification preferences updated successfully'

--
Gitblit v1.10.0