Open alanorth opened 3 weeks ago
Thanks @alanorth , there are definitely improvements to be made here.
The way i wrote that was to return a simple list of the objects themselves... what we should probably do instead is implement the full search query and response as per the REST contract, which would include this page info in the embedded search results object:
"page": {
"number": 0,
"size": 20,
"totalPages": 35,
"totalElements": 696
},
So I will look at making this the "proper" way to search, handling the full query and filter stuff for the POST and returning an object properly modelled on the response.
Thanks @kshepherd. This library has already helped me by reducing some boilerplate code when interacting with the DSpace 7 REST API. Your proposed improvements sound good.
The
search_objects
function is tricky to use because there is no way to know how many pages of results there are. I came up with this, managing thepage
variable in a loop and waiting until the number of results is less than 20 (default size):Is there a better way to do this with the current state of the client? Thanks!