From 41c48126bf0c3591d0031e3a935d075211ca7da7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Albert=20Juh=C3=A9=20Lluveras?= Date: Sat, 15 Dec 2018 13:09:47 +0100 Subject: [PATCH] Rename isGetCustomersError to getCustomersError --- .../client/analytics/report/customers/table.js | 2 +- .../client/wc-api/customers/selectors.js | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/plugins/woocommerce-admin/client/analytics/report/customers/table.js b/plugins/woocommerce-admin/client/analytics/report/customers/table.js index 3a7bba5e725..3920a3bb849 100644 --- a/plugins/woocommerce-admin/client/analytics/report/customers/table.js +++ b/plugins/woocommerce-admin/client/analytics/report/customers/table.js @@ -177,7 +177,7 @@ export default class CustomersReportTable extends Component { endpoint="customers" extendItemsMethodNames={ { load: 'getCustomers', - isError: 'isGetCustomersError', + isError: 'getCustomersError', isRequesting: 'isGetCustomersRequesting', } } getHeadersContent={ this.getHeadersContent } diff --git a/plugins/woocommerce-admin/client/wc-api/customers/selectors.js b/plugins/woocommerce-admin/client/wc-api/customers/selectors.js index 315c878f974..bb72925b7f5 100644 --- a/plugins/woocommerce-admin/client/wc-api/customers/selectors.js +++ b/plugins/woocommerce-admin/client/wc-api/customers/selectors.js @@ -20,6 +20,11 @@ const getCustomers = ( getResource, requireResource ) => ( return ids.map( id => getResource( getResourceName( 'customer', id ) ).data || {} ); }; +const getCustomersError = getResource => ( query = {} ) => { + const resourceName = getResourceName( 'customers-query', query ); + return getResource( resourceName ).error; +}; + const isGetCustomersRequesting = getResource => ( query = {} ) => { const resourceName = getResourceName( 'customers-query', query ); const { lastRequested, lastReceived } = getResource( resourceName ); @@ -31,13 +36,8 @@ const isGetCustomersRequesting = getResource => ( query = {} ) => { return lastRequested > lastReceived; }; -const isGetCustomersError = getResource => ( query = {} ) => { - const resourceName = getResourceName( 'customers-query', query ); - return getResource( resourceName ).error; -}; - export default { getCustomers, + getCustomersError, isGetCustomersRequesting, - isGetCustomersError, };