Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
RozmarinUS committed Sep 14, 2023
1 parent 2d7405f commit cc6d044
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/paginate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,10 +39,10 @@ export class Paginated<T> {
data: T[]
payload: {
pagination: {
itemsPerPage: number
limit: number
totalItems: number
currentPage: number
totalPages: number
page: number
total: number
sortBy: SortBy<T>
searchBy: Column<T>[]
search: string
Expand Down Expand Up @@ -401,10 +401,10 @@ export async function paginate<T extends ObjectLiteral>(
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,
Expand Down

0 comments on commit cc6d044

Please sign in to comment.