diff --git a/package.json b/package.json index a467826f..0cdf3db1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "ra-jsonapi-client", - "version": "0.6.0", + "version": "0.6.1", "description": "JSON API data provider for react-admin.", "main": "build/index.js", "scripts": { diff --git a/src/index.js b/src/index.js index 8cda45a4..a4c09fed 100644 --- a/src/index.js +++ b/src/index.js @@ -138,7 +138,7 @@ export default (apiUrl, userSettings = {}) => (type, resource, params) => { // When meta data and the 'total' setting is provided try // to get the total count. if (response.data.meta && settings.total) { - total = response.data.data.length; + total = response.data.meta[settings.total]; } // Use the length of the data array as a fallback.