This commit is contained in:
Riccardo
2021-01-02 10:17:51 +01:00
parent 529c99cc9d
commit c503984d92

View File

@@ -56,7 +56,7 @@ const NEW_LINKS_SUBSCRIPTION = gql`
const getQueryVariables = (isNewPage, page) => { const getQueryVariables = (isNewPage, page) => {
const skip = isNewPage ? (page - 1) * LINKS_PER_PAGE : 0; const skip = isNewPage ? (page - 1) * LINKS_PER_PAGE : 0;
const take = isNewPage ? LINKS_PER_PAGE : 10; const take = isNewPage ? LINKS_PER_PAGE : 100;
const orderBy = { createdAt: 'desc' }; const orderBy = { createdAt: 'desc' };
console.log(isNewPage, page, LINKS_PER_PAGE, skip, take, orderBy); console.log(isNewPage, page, LINKS_PER_PAGE, skip, take, orderBy);
return { take, skip, orderBy }; return { take, skip, orderBy };
@@ -72,8 +72,8 @@ const LinkList = () => {
); );
const page = parseInt( const page = parseInt(
pageIndexParams.length - 1 // pageIndexParams.length - 1
// pageIndexParams[pageIndexParams.length - 1] pageIndexParams[pageIndexParams.length - 1]
); );
console.log(pageIndexParams.length, page); console.log(pageIndexParams.length, page);