diff --git a/src/paginate.ts b/src/paginate.ts index 1a85bb6..b26cd11 100644 --- a/src/paginate.ts +++ b/src/paginate.ts @@ -39,10 +39,10 @@ export class Paginated { data: T[] payload: { pagination: { - itemsPerPage: number + limit: number totalItems: number - currentPage: number - totalPages: number + page: number + total: number sortBy: SortBy searchBy: Column[] search: string @@ -401,10 +401,10 @@ export async function paginate( data: items, payload: { pagination: { - itemsPerPage: isPaginated ? limit : items.length, + limit: isPaginated ? limit : items.length, totalItems: isPaginated ? totalItems : items.length, - currentPage: page, - totalPages, + page: page, + total: totalPages, sortBy, search: query.search, searchBy: query.search ? searchBy : undefined,