Skip to content
This repository has been archived by the owner on Sep 7, 2020. It is now read-only.

Commit

Permalink
@phenomic/core: Fix "hasNextPage" & "next" reference for a pagina…
Browse files Browse the repository at this point in the history
…ted query when a page ends with the last item of the entire collection
  • Loading branch information
MoOx committed Sep 16, 2017
1 parent 83b0181 commit 7c16768
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion packages/core/src/api/index.js
Expand Up @@ -8,7 +8,7 @@ export const encode = (text: string) => new Buffer(text).toString("base64");
export const decode = (text: string) => new Buffer(text, "base64").toString();

const connect = (list, limit, previousList = []) => {
const hasNextPage = limit === undefined ? false : list.length >= limit;
const hasNextPage = limit === undefined ? false : list.length > limit;
const hasPreviousPage = previousList.length > 0;
const previousPageIsFirst = limit ? previousList.length <= limit : undefined;
// we are retrieving limit + 1 to know if there is more page or not
Expand Down

0 comments on commit 7c16768

Please sign in to comment.