Skip to content

Commit

Permalink
feat: args added to /dokan/v1/stores/batch(POST, PUT,PATCH)
Browse files Browse the repository at this point in the history
  • Loading branch information
pronob1010 committed Nov 25, 2024
1 parent 15e49f4 commit 2f8552c
Showing 1 changed file with 30 additions and 4 deletions.
34 changes: 30 additions & 4 deletions includes/REST/StoreController.php
Original file line number Diff line number Diff line change
Expand Up @@ -86,15 +86,15 @@ 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' => [
'required' => false,
'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' ),
Expand All @@ -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' => [
Expand All @@ -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' => [
Expand Down Expand Up @@ -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' ),
],
],
],
]
);
Expand Down

0 comments on commit 2f8552c

Please sign in to comment.