Skip to content

Commit

Permalink
chore(fake): make paginate method use findMany
Browse files Browse the repository at this point in the history
  • Loading branch information
jlenon7 committed Apr 24, 2024
1 parent 6ef99a2 commit fefc76b
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@athenna/database",
"version": "4.44.0",
"version": "4.45.0",
"description": "The Athenna database handler for SQL/NoSQL.",
"license": "MIT",
"author": "João Lenon <[email protected]>",
Expand Down
4 changes: 3 additions & 1 deletion src/database/drivers/FakeDriver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -391,7 +391,9 @@ export class FakeDriver {
limit = 10,
resourceUrl = '/'
): Promise<PaginatedResponse<T>> {
return Exec.pagination([{}], 1, { page, limit, resourceUrl })
const data = await this.findMany()

return Exec.pagination(data, data.length, { page, limit, resourceUrl })
}

/**
Expand Down

0 comments on commit fefc76b

Please sign in to comment.