← Back to team overview

dhis2-devs-core team mailing list archive

Re: Paging total being wrong on empty result?

 

Hi Mark

I think it has been like this since the first time we introduced the pager
element.. I agree its a bit weird

Total should be 0 of course, do we still want to see pageCount = 1 ? even
if there is no results? or would that be pagecount = 0 ?

On Thu Jan 15 2015 at 10:44:43 PM Mark Polak <markpo@xxxxxxxxxx> wrote:

> Hey Morten,
>
> I ran into a sort of peculiar thing and i believe it is a small bug.
>
> When requesting an endpoint with a filter that returns no results. The
> pager object still marks the total items as being 1.
> https://apps.dhis2.org/dev/api/dataElements?filter=name:like:sdfdsfsfgdfdd
>
> {
> -pager: {
> page: 1,
> pageCount: 1,
> total: 1
> },
> -dataElements: (0)[
> ]
> }
>
> Kind regards,
>
> Mark Polak
> mark@xxxxxxxxxxxxxxx
> markpo@xxxxxxxxxx
> +47 970 36 752
>
>

Follow ups

References