aimeos / ai-client-jsonapi

Aimeos frontend JSON API
GNU Lesser General Public License v3.0
28 stars 6 forks source link

Fix non-matching default limit #20

Closed tobbe-j closed 2 years ago

tobbe-j commented 2 years ago

The default for page/limit was different in client/jsonapi/src/Client/JsonApi/Supplier/Standard.php compared to here (25 there vs 100 here). This was causing the next link to be incorrectly excluded from the response when there was over 25 suppliers.

The next calculation with a total of 28 would here be:

$next = ( $offset + $limit < $total ? $offset + $limit : null ); // 0  + 100 < 28 => $next = null

Even though the there would only be 25 entries in $items

aimeos commented 2 years ago

Thanks a lot!