dhis2-devs-core team mailing list archive
-
dhis2-devs-core team
-
Mailing list archive
-
Message #00296
Small api issues with the users endpoint
Hey Morten,
Some small things i found when "API-ing".
None of these things are really urgent. The paging thing i would say would be the highest priority as it breaks the paging for the DATIM user app. (When users filter on certain stuff, the page numbers will always stay the same)
User endpoint paging (demo & dev):
The pager still gives information for all the users in the system, even when filtering is applied.
https://apps.dhis2.org/dev/api/users.json?pageSize=10&filter=name:like:John
https://apps.dhis2.org/demo/api/users.json?pageSize=10&filter=name:like:John
User endpoint oddity
While creating the examples above i noticed something else that is a bit odd.
pageSize of 5 or lower returns 1 result
https://apps.dhis2.org/demo/api/users.json?pageSize=5&filter=name:like:John
pageSize of 6 or more returns 2 results
https://apps.dhis2.org/demo/api/users.json?pageSize=6&filter=name:like:John
Organisation units endpoint sorting combined with special level attribute
When using the special level=3 parameter the sort parameter does not work anymore (I guess this has to do something with that the level thing does some special query stuff)
Correctly sorts by name
https://apps.dhis2.org/demo/api/organisationUnits.json?filter=level:eq:3&sort=name:asc
Sorting by name stop sorting
https://apps.dhis2.org/demo/api/organisationUnits.json?level=3&sort=name:asc
Pager does not respect filtering (Any endpoint)
When requesting a url like the following the nextPage attribute of the pager omits the filter from the nextPage. This makes the nextPage not reliable for trying to get the next page. I'd have to re-add the filters for each previous or next page.
https://apps.dhis2.org/demo/api/dataElements.json?filter=name:like:A
Regards,
Mark
Follow ups