fix pagination and /users

This commit is contained in:
2023-07-17 10:50:44 +02:00
parent 68c963b0f0
commit 3879bedf53
2 changed files with 18 additions and 5 deletions

View File

@@ -25,9 +25,14 @@ export class UsersController {
@Get()
async findAll(@Query() query) {
const { page, pageSize } = Pagination.getPaginationData(query)
const { currentPage, itemsPerPage } = Pagination.getPaginationData(query)
const users = await this.usersService.getUsers(page, pageSize, query.name, query.email)
const users = await this.usersService.getUsers(
currentPage,
itemsPerPage,
query.name,
query.email
)
if (!users) throw new NotFoundException('Users not found')