Skip to content

Commit

Permalink
Add timeout and max_lock_period properties to the lock endponint's re…
Browse files Browse the repository at this point in the history
…sponse
  • Loading branch information
ice9js committed Jan 30, 2018
1 parent 518a8f1 commit de75603
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions includes/class-zoninator-api-controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -288,14 +288,16 @@ function zone_update_lock( $request ) {
$locking_user = get_userdata( $zone_locked );
return new WP_REST_Response( array(
'zone_id' => $this->instance->get_zone_id( $zone ),
'locking_user' => $locking_user->display_name,
'blocked' => true,
), 400);
}

$this->instance->lock_zone( $zone_id );
return new WP_REST_Response( array(
'zone_id' => $this->instance->get_zone_id( $zone ),
), 200);
'timeout' => $this->instance->zone_lock_period,
'max_lock_period' => $this->instance->zone_max_lock_period,
), 200 );
}

/**
Expand Down

0 comments on commit de75603

Please sign in to comment.