Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remote Pagination bug when last page has only 1 item #106

Closed
gabrielguerrero opened this issue Jun 29, 2024 · 3 comments · Fixed by #110
Closed

Remote Pagination bug when last page has only 1 item #106

gabrielguerrero opened this issue Jun 29, 2024 · 3 comments · Fixed by #110

Comments

@gabrielguerrero
Copy link
Owner

There is a bug in withEntitiesRemotePagination , that makes the last page not render if it has only one item
Example of a case that produces the error

   const Store = signalStore(
  withEntities({ entity, ollection: productsCollection }),
  withCallStatus({ ollection: productsCollection }),
  withEntitiesRemotePagination({
    entity,
    ollection: productsCollection,
    pageSize: 10,
    pagesToCache: 1,
  }),
  withEntitiesLoadingCall(
    ({ productsPagedRequest, productsFilter, productsSort }) => ({
      collection: productsCollection,
      fetchEntities: async () => {
        const res = await lastValueFrom(
          inject(ProductService).getProducts({
            search: productsFilter().search,
            skip: productsPagedRequest().startIndex,
            take: productsPagedRequest().size,
            sortAscending: productsSort().direction === "asc",
            sortColumn: productsSort().field,
          }),
        );
        return { entities: res.resultList, total: res.total };
      },
      mapError: (error) => (error as Error).message,
    }),
  ),
);


Copy link

🎉 This issue has been resolved in version 17.9.0-beta.2 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

github-actions bot commented Jul 2, 2024

🎉 This issue has been resolved in version 17.9.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Copy link

🎉 This issue has been resolved in version 17.9.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant