Rename isGetCustomersError to getCustomersError
This commit is contained in:
parent
346ed578ae
commit
41c48126bf
|
@ -177,7 +177,7 @@ export default class CustomersReportTable extends Component {
|
||||||
endpoint="customers"
|
endpoint="customers"
|
||||||
extendItemsMethodNames={ {
|
extendItemsMethodNames={ {
|
||||||
load: 'getCustomers',
|
load: 'getCustomers',
|
||||||
isError: 'isGetCustomersError',
|
isError: 'getCustomersError',
|
||||||
isRequesting: 'isGetCustomersRequesting',
|
isRequesting: 'isGetCustomersRequesting',
|
||||||
} }
|
} }
|
||||||
getHeadersContent={ this.getHeadersContent }
|
getHeadersContent={ this.getHeadersContent }
|
||||||
|
|
|
@ -20,6 +20,11 @@ const getCustomers = ( getResource, requireResource ) => (
|
||||||
return ids.map( id => getResource( getResourceName( 'customer', id ) ).data || {} );
|
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 isGetCustomersRequesting = getResource => ( query = {} ) => {
|
||||||
const resourceName = getResourceName( 'customers-query', query );
|
const resourceName = getResourceName( 'customers-query', query );
|
||||||
const { lastRequested, lastReceived } = getResource( resourceName );
|
const { lastRequested, lastReceived } = getResource( resourceName );
|
||||||
|
@ -31,13 +36,8 @@ const isGetCustomersRequesting = getResource => ( query = {} ) => {
|
||||||
return lastRequested > lastReceived;
|
return lastRequested > lastReceived;
|
||||||
};
|
};
|
||||||
|
|
||||||
const isGetCustomersError = getResource => ( query = {} ) => {
|
|
||||||
const resourceName = getResourceName( 'customers-query', query );
|
|
||||||
return getResource( resourceName ).error;
|
|
||||||
};
|
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
getCustomers,
|
getCustomers,
|
||||||
|
getCustomersError,
|
||||||
isGetCustomersRequesting,
|
isGetCustomersRequesting,
|
||||||
isGetCustomersError,
|
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue