From c204185ae86a98994f80010abf35a190c9406739 Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Sun, 12 Jul 2026 18:08:19 +0000
Subject: [PATCH] =Refactor of Integrations.php. Separated different functionality into traits that classes can use to add that functionality. Hopefully will make maintaining it a little easier. Still have to finish up, as well as refactoring the individual classes to utilize the new system.
---
inc/rest/routes/ContentRoutes.php | 8 +++-----
1 files changed, 3 insertions(+), 5 deletions(-)
diff --git a/inc/rest/routes/ContentRoutes.php b/inc/rest/routes/ContentRoutes.php
index b5beed6..9375fa2 100644
--- a/inc/rest/routes/ContentRoutes.php
+++ b/inc/rest/routes/ContentRoutes.php
@@ -88,12 +88,11 @@
'dateFrom' => 'string',
'dateTo' => 'string',
])
- ->rateLimit(20)
+ ->rateLimit(30)
->post([$this, 'postContent'])
->auth(PermissionHandler::combine(['user', 'nonce', ['actionNonce'=>'dash-']]))
- ->rateLimit(30)
+ ->rateLimit()
->args([
- 'user' => 'int|required',
'posts' => 'required',
'content' => 'string',
])
@@ -163,7 +162,7 @@
public function postContent(WP_REST_Request $request): WP_REST_Response
{
$data = $request->get_params();
- $user_id = $data['user'];
+ $user_id = get_current_user_id();
if (!array_key_exists('posts', $data) || !is_array($data['posts'])) {
return Response::success(['message'=>'No posts found in request']);
@@ -172,7 +171,6 @@
$count = count($data['posts']);
$operationId = $data['id'];
- unset($data['user']);
unset($data['id']);
error_log('[CONTENT]:'.print_r($data, true));
--
Gitblit v1.10.0