Skip to content

Commit

Permalink
Fix: empty id returning when create withdraw by api.
Browse files Browse the repository at this point in the history
  • Loading branch information
Aunshon committed Nov 27, 2023
1 parent 52235e1 commit 2a125d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion includes/REST/WithdrawController.php
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,7 @@ public function create_item( $request ) {
throw new DokanException( $result->get_error_code(), $result->get_error_message(), 400 );
}

$response = $this->prepare_item_for_response( $withdraw, $request );
$response = $this->prepare_item_for_response( $result, $request );
$response = rest_ensure_response( $response );

$response->set_status( 201 );
Expand Down
2 changes: 1 addition & 1 deletion includes/Withdraw/Withdraw.php
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ public function get_withdraw() {
* @return int
*/
public function get_id() {
return $this->data['id'];
return $this->data['id'] ?? 0;
}

/**
Expand Down

0 comments on commit 2a125d1

Please sign in to comment.