From 109592ebc93cd7800149e194b4718e9270ba1b82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Thu, 29 Nov 2018 19:00:51 -0600 Subject: [PATCH] Don't encode search text in autocompleters before stringifying it (https://github.com/woocommerce/woocommerce-admin/pull/959) --- .../packages/components/src/search/autocompleters/coupons.js | 2 +- .../components/src/search/autocompleters/product-cat.js | 2 +- .../packages/components/src/search/autocompleters/product.js | 2 +- .../packages/components/src/search/autocompleters/taxes.js | 2 +- .../packages/components/src/search/autocompleters/variations.js | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/coupons.js b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/coupons.js index c3a743a0dfd..832a052ccce 100644 --- a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/coupons.js +++ b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/coupons.js @@ -27,7 +27,7 @@ export default { let payload = ''; if ( search ) { const query = { - search: encodeURIComponent( search ), + search, per_page: 10, }; payload = stringifyQuery( query ); diff --git a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product-cat.js b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product-cat.js index 41e4fd87ba1..1bcafd3ec30 100644 --- a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product-cat.js +++ b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product-cat.js @@ -27,7 +27,7 @@ export default { let payload = ''; if ( search ) { const query = { - search: encodeURIComponent( search ), + search, per_page: 10, orderby: 'count', }; diff --git a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product.js b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product.js index 9f148f63f2d..f117014de53 100644 --- a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product.js +++ b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/product.js @@ -28,7 +28,7 @@ export default { let payload = ''; if ( search ) { const query = { - search: encodeURIComponent( search ), + search, per_page: 10, orderby: 'popularity', }; diff --git a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/taxes.js b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/taxes.js index c15f73bdc56..f5475951c01 100644 --- a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/taxes.js +++ b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/taxes.js @@ -27,7 +27,7 @@ export default { let payload = ''; if ( search ) { const query = { - search: encodeURIComponent( search ), + search, per_page: 10, }; payload = stringifyQuery( query ); diff --git a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/variations.js b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/variations.js index 5b91c210c0e..2b3fcc4be4a 100644 --- a/plugins/woocommerce-admin/packages/components/src/search/autocompleters/variations.js +++ b/plugins/woocommerce-admin/packages/components/src/search/autocompleters/variations.js @@ -43,7 +43,7 @@ export default { let payload = ''; if ( search ) { const query = { - search: encodeURIComponent( search ), + search, per_page: 10, }; payload = stringifyQuery( query );