Skip to content

Commit

Permalink
Fix total length bug
Browse files Browse the repository at this point in the history
Fixes #25 thanks to @jfedik
  • Loading branch information
Henning Vogt committed Nov 1, 2019
1 parent dd65b86 commit 919f48e
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion 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": {
Expand Down
2 changes: 1 addition & 1 deletion src/index.js
Expand Up @@ -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.
Expand Down

0 comments on commit 919f48e

Please sign in to comment.