From 2f8552c6827275bdfe57c2044862e2bc646d8fc4 Mon Sep 17 00:00:00 2001 From: pronob1010 Date: Mon, 25 Nov 2024 11:28:43 +0600 Subject: [PATCH] feat: args added to /dokan/v1/stores/batch(POST, PUT,PATCH) --- includes/REST/StoreController.php | 34 +++++++++++++++++++++++++++---- 1 file changed, 30 insertions(+), 4 deletions(-) diff --git a/includes/REST/StoreController.php b/includes/REST/StoreController.php index 900c49a30..cba0c55de 100644 --- a/includes/REST/StoreController.php +++ b/includes/REST/StoreController.php @@ -86,7 +86,7 @@ public function register_routes() { ], 'show_email' => [ 'required' => false, - 'type' => 'string', // Updated from boolean + 'type' => 'string', 'description' => __( 'Whether to show the store email publicly.', 'dokan-lite' ), ], 'address' => [ @@ -94,7 +94,7 @@ public function register_routes() { 'type' => 'array', 'description' => __( 'Address details of the store.', 'dokan-lite' ), ], - 'location' => [ // Newly added + 'location' => [ 'required' => false, 'type' => 'string', 'description' => __( 'Geographical location of the store.', 'dokan-lite' ), @@ -116,7 +116,7 @@ public function register_routes() { ], 'enable_tnc' => [ 'required' => false, - 'type' => 'string', // Updated from boolean + 'type' => 'string', 'description' => __( 'Enable Terms and Conditions for the store.', 'dokan-lite' ), ], 'store_tnc' => [ @@ -126,7 +126,7 @@ public function register_routes() { ], 'show_min_order_discount' => [ 'required' => false, - 'type' => 'string', // Updated from boolean + 'type' => 'string', 'description' => __( 'Whether to show minimum order discount information.', 'dokan-lite' ), ], 'store_seo' => [ @@ -308,6 +308,32 @@ public function register_routes() { 'methods' => WP_REST_Server::EDITABLE, 'callback' => [ $this, 'batch_update' ], 'permission_callback' => [ $this, 'permission_check_for_manageable_part' ], + 'args' => [ + 'approved' => [ + 'type' => 'array', + 'required' => false, + 'items' => [ + 'type' => 'integer', + ], + 'description' => __( 'List of vendor IDs to approve.', 'dokan-lite' ), + ], + 'pending' => [ + 'type' => 'array', + 'required' => false, + 'items' => [ + 'type' => 'integer', + ], + 'description' => __( 'List of vendor IDs to set as pending.', 'dokan-lite' ), + ], + 'delete' => [ + 'type' => 'array', + 'required' => false, + 'items' => [ + 'type' => 'integer', + ], + 'description' => __( 'List of vendor IDs to delete.', 'dokan-lite' ), + ], + ], ], ] );