fix update bg process api endpoint

This commit is contained in:
Leo Germani 2018-09-17 15:07:20 -03:00
parent bf3c7a6574
commit bb72e48b4f
1 changed files with 8 additions and 1 deletions

View File

@ -235,12 +235,19 @@ class REST_Background_Processes_Controller extends REST_Controller {
}
}
$query = "UPDATE $this->table $status_q WHERE 1=1 $id_q $user_q";
$query = "UPDATE $this->table SET $status_q WHERE 1=1 $id_q $user_q";
$result = $wpdb->query($query);
$query = "SELECT * FROM $this->table WHERE 1=1 $id_q $user_q LIMIT 1";
$result = $wpdb->get_row($query);
$result = $this->prepare_item_for_response($result, $request);
return new \WP_REST_Response( $result, 200 );
}
public function delete_item( $request ) {