Allow strings in downloads report order number filter.
This commit is contained in:
parent
0013495fff
commit
164a55b0d2
|
@ -3,7 +3,6 @@
|
|||
* External dependencies
|
||||
*/
|
||||
import apiFetch from '@wordpress/api-fetch';
|
||||
import { isNaN } from 'lodash';
|
||||
|
||||
/**
|
||||
* WooCommerce dependencies
|
||||
|
@ -24,18 +23,11 @@ import { computeSuggestionMatch } from './utils';
|
|||
export default {
|
||||
name: 'orders',
|
||||
className: 'woocommerce-search__order-result',
|
||||
inputType: 'number',
|
||||
options( search ) {
|
||||
let payload = '';
|
||||
if ( search ) {
|
||||
const number = parseInt( search );
|
||||
|
||||
if ( isNaN( number ) ) {
|
||||
return;
|
||||
}
|
||||
|
||||
const query = {
|
||||
number,
|
||||
number: search,
|
||||
per_page: 10,
|
||||
};
|
||||
payload = stringifyQuery( query );
|
||||
|
|
|
@ -46,7 +46,7 @@ class WC_Tests_API_Orders extends WC_REST_Unit_Test_Case {
|
|||
$request = new WP_REST_Request( 'GET', $this->endpoint );
|
||||
$request->set_query_params(
|
||||
array(
|
||||
'number' => $order->get_id(),
|
||||
'number' => (string) $order->get_id(),
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue