[Fixed in 2.0.5] API paginator

Unimus support forum
Post Reply
ptorbjornsson
Posts: 23
Joined: Tue Aug 11, 2020 12:08 pm

Mon Aug 24, 2020 12:43 pm

I am on version 2.0.2.

When doing API requests that return multipage results, the page and device count seems to be off.
When I do a request for e.g. device by description (http://unimus/api/v2/devices/findByDesc ... escription>), the pagination data seems to return the total number of devices in the database, and not the devices matching the search. The exemption being when I hit the last page, where it returns the correct results.

Example:

When searching for a description that should return 379 devices, with a result size of 50, page 0:
http://unimus/api/v2/devices/findByDesc ... =50&page=0
"paginator":{"totalCount":22728,"totalPages":455,"page":0,"size":50}}

Then page 7 (last page) for the same search:
http://unimus/api/v2/devices/findByDesc ... =50&page=7
"paginator":{"totalCount":379,"totalPages":8,"page":7,"size":50}}

Is there something I am doing wrong here, or is it a bug in the API?

Thank you in advance for any input.
Sachtilah
Posts: 4
Joined: Wed Oct 05, 2016 4:11 pm

Mon Aug 24, 2020 3:07 pm

Hi, thank you for reporting it.

This is definitely a bug in the API. It will be fixed in the next 2.0.5 release.
ptorbjornsson
Posts: 23
Joined: Tue Aug 11, 2020 12:08 pm

Tue Aug 25, 2020 6:12 am

Hi,

Perfect, thank you for your quick reply.
I'll work around it until the next update.
Post Reply