From f16cb88a3218ac7bb32e43f0e0a2542d35c7a01b Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Wed, 17 Jun 2026 00:28:16 +0000
Subject: [PATCH] =Working on the Options Meta still. Group fields also needed some changes

---
 inc/rest/routes/OptionsRoutes.php |   16 ++++------------
 1 files changed, 4 insertions(+), 12 deletions(-)

diff --git a/inc/rest/routes/OptionsRoutes.php b/inc/rest/routes/OptionsRoutes.php
index 355db8c..de1f75a 100644
--- a/inc/rest/routes/OptionsRoutes.php
+++ b/inc/rest/routes/OptionsRoutes.php
@@ -1,6 +1,8 @@
 <?php
 namespace JVBase\rest\routes;
 
+use JVBase\base\Options;
+use JVBase\registrar\Registrar;
 use JVBase\rest\PermissionHandler;
 use JVBase\rest\Rest;
 use JVBase\managers\Cache;
@@ -80,15 +82,7 @@
 			'success'	=> []
 		];
 
-		$meta = Meta::forOptions('options');
-		$fields = jvbGetFields('options');
-
-		$allowedFields = array_filter($data,
-		function ($key) use ($fields) {
-			return array_key_exists($key, $fields);
-		}, ARRAY_FILTER_USE_KEY);
-		error_log('Setting fields: '.print_r($allowedFields, true));
-		$results = $meta->setAll($allowedFields);
+		Options::setAll($data['changes']);
 //		foreach ($data as $field => $value) {
 //			if (array_key_exists($field, $fields)) {
 //				$success = $meta->updateValue($field, $value);
@@ -102,11 +96,9 @@
 
 		do_action('jvbOptionsRoute', $data);
 
-		$cache = Cache::for('options', 1800);
-		$cache->flush();
 		return [
 			'success'	=> true,
-			'result'	=> $results
+			'result'	=> []
 		];
 	}
 }

--
Gitblit v1.10.0