From 07227271fd245e7513d4ad6f841ff84ca29c6e0c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Fri, 14 Dec 2018 17:19:30 +0100 Subject: [PATCH] Avoid duplicated ids when searching customers from the table search box --- .../packages/components/src/table/index.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/plugins/woocommerce-admin/packages/components/src/table/index.js b/plugins/woocommerce-admin/packages/components/src/table/index.js index 51584c260a0..cc54315110e 100644 --- a/plugins/woocommerce-admin/packages/components/src/table/index.js +++ b/plugins/woocommerce-admin/packages/components/src/table/index.js @@ -148,7 +148,7 @@ class TableCard extends Component { } onSearch( values ) { - const { compareBy, compareParam, onQueryChange, query, searchBy, searchParam } = this.props; + const { compareBy, compareParam, onQueryChange, searchBy, searchParam } = this.props; const ids = values.map( v => v.id ); if ( compareBy ) { const { selectedRows } = this.state; @@ -158,9 +158,7 @@ class TableCard extends Component { [ ...selectedRows, ...ids ].join( ',' ) ); } else if ( searchBy ) { - const currentSearchIds = getIdsFromQuery( query[ searchParam ] ); - const newSearchIds = currentSearchIds.concat( ids ); - onQueryChange( searchParam )( newSearchIds.join( ',' ) ); + onQueryChange( searchParam )( ids.join( ',' ) ); } }