You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This adds a new includeTotalCount flag that by default exposes the current range and total count as specified in content-range and a property totalCountHeader, which if set to anything other than 'content-range' will add a header that contains just the total number of elements
The reason will be displayed to describe this comment to others. Learn more.
If you'd be willing to flesh this out further to hit the other spots with count support and add documentation to the README, I'd be happy to merge this.
hrm... in populate modelFull[options.associationAttr] is used to get the length but later modelFull is returned. Does it make sense to return the full object? I mean only the association (the array of items) is/should be populated.
That way it's easier to work with the data, since just the array is returned. Esp since we also do pagination, that seems odd.
Then it might make more sense to rewrite the query so it just uses the base object for the join but doesn't select anything from it.
I have some ideas on populate: Currently it's only possible to populate one specific key. The user may want to populate some or all of them. And for a particular object. So it may make sense to provide a query parameter for find-by-id (or even find aswell) where the user can specify "*" or a comma-seperated list of association attributes to populate.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds a new includeTotalCount flag that by default exposes the current range and total count as specified in content-range and a property totalCountHeader, which if set to anything other than 'content-range' will add a header that contains just the total number of elements
This is more or less an attempt to be compatible with whatever https://www.npmjs.com/package/ra-data-simple-rest expects as return value
Note: this is incomplete as it's missing support in other tandys with count support