From df00ba7bb90e1be3e402bb07f8dd195d0cbca8b7 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Thu, 19 Jun 2025 13:23:01 +0100 Subject: [PATCH 1/2] revert back to name on the api --- mu-plugins/osi-api/osi-api.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mu-plugins/osi-api/osi-api.php b/mu-plugins/osi-api/osi-api.php index 175bb71..e50b18b 100644 --- a/mu-plugins/osi-api/osi-api.php +++ b/mu-plugins/osi-api/osi-api.php @@ -49,7 +49,7 @@ public function register_routes() { 'callback' => array( $this, 'get_licenses' ), 'permission_callback' => '__return_true', 'args' => array( - 'id' => array( + 'name' => array( 'required' => false, 'type' => 'string', 'description' => 'Filter by license name', @@ -111,7 +111,7 @@ public function register_routes() { public function get_licenses( WP_REST_Request $data ) { // Check if we have an ID passed. - $searched_slug = $data->get_param( 'id' ); + $searched_slug = $data->get_param( 'name' ); // Check if we have any keyword passed. $keyword = $data->get_param( 'keyword' ); From 00932a99cc716d6a3fe1acd3a5e6f3f69078e495 Mon Sep 17 00:00:00 2001 From: Glynn Quelch Date: Thu, 19 Jun 2025 13:34:10 +0100 Subject: [PATCH 2/2] Fix simple liniting issues --- mu-plugins/osi-api/osi-api.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mu-plugins/osi-api/osi-api.php b/mu-plugins/osi-api/osi-api.php index e50b18b..6f47e19 100644 --- a/mu-plugins/osi-api/osi-api.php +++ b/mu-plugins/osi-api/osi-api.php @@ -49,7 +49,7 @@ public function register_routes() { 'callback' => array( $this, 'get_licenses' ), 'permission_callback' => '__return_true', 'args' => array( - 'name' => array( + 'name' => array( 'required' => false, 'type' => 'string', 'description' => 'Filter by license name',