Problem/Motivation
The extra module jsonapi_defaults contains options to add in default filters but not default sorting.
Would be good if changes could be made to also add this feature.
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | jsonapi_extras-default-sorting-3169654-6.patch | 8.26 KB | 3li |
| #2 | jsonapi_extras-default-sorting-3169654-2.patch | 5.58 KB | 3li |
Issue fork jsonapi_extras-3169654
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
3liHave added options for default sorting, inside the jsonapi_defaults module.
Comment #3
3liComment #4
bbralaThanks for helping out! This is quite usefull.
Looking good but is missing tests. Could you add a test that applies the sort and one that then overrides it? Have a look at
JsonApiExtrasFunctionalTest::testSortOverwrittenFieldfor inspiration :)Comment #5
3liSure will look at adding test ASAP.
Comment #6
3liHave added some tests for checking default sorting and confirming overriding default sorting takes priority.
Comment #8
3liOpened up merge request as easier to review & test :)
Comment #9
abu-zakham commentedWorked for me.
Comment #11
bbralaThanks for the work! Reviewed and pushes :)