-
Notifications
You must be signed in to change notification settings - Fork 3.9k
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
NV 2613 - Tenant Page Pagination #3859
NV 2613 - Tenant Page Pagination #3859
Conversation
|
||
export class PaginatedResponseDto<T> { | ||
export class PaginatedResponseDto<T> implements IPaginatedResponseDto<T> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added new Shared IPaginatedResponseDto as an interface for the API DTO
export function getTenants() { | ||
return api.get('/v1/tenants'); | ||
export function getTenants({ page = 0, limit = 10 } = {}) { | ||
return api.getFullResponse('/v1/tenants', { page, limit }); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
changed to get the hasMore and other pagination data.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
refactored to get the full response of the pagination and return from the hook.
page, | ||
limit, | ||
}: { | ||
options?: UseQueryOptions<IPaginatedResponseDto<ITenantEntity>, any>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the place where i wanted to reuse the IPaginatedResponseDto interface.
pagination={{ | ||
pageSize: pageSize, | ||
current: page, | ||
hasMore, | ||
minimalPagination: true, | ||
onPageChange: handleTableChange, | ||
}} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
added the pagination prop data.
libs/shared/src/dto/shared/shared.ts
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
new interface that i used in the useTenant hook and API DTO
…ge-pagination # Conflicts: # apps/web/src/pages/tenants/components/list/TenantsList.tsx
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⭐️
What change does this PR introduce?
Created the same pagination we have on the subscriber list page in order to reuse existing components.
Why was this change needed?
in order to check long lists of tenants.
Other information (Screenshots)
https://www.loom.com/share/f8e823495fe34c2d9fa542da79b60f0f