Support react-admin for Loopback 3 by adding Content-Range header.
npm install --save loopback-content-range
Modify your server/component-config.json to include this module:
{
"loopback-content-range": {
"pattern": [
"*.find"
],
"relatedModels": true
},
}
Method patterns that Content-Range
header will be added.
Accepted patterns: See https://loopback.io/doc/en/lb3/Remote-hooks.html#wildcards.
Default value: [ "*.find" ]
, which auto added to find method of all models.
Apply Content-Range
to all related models.
Set the default value when no limit parameter is passed on filter. If no defaultLimit value is defined it will assume the maxLimit value.
Set the maximum value of the limit paramater on filter.
To fetch all records, do not define any values for defaultLimit and maxLimit.
Based on loopback3-xTotalCount and loopback-component-react-admin