mirror of
https://github.com/ershisan99/flashcards-api.git
synced 2025-12-18 12:33:21 +00:00
fix pagination and create pagination service
This commit is contained in:
@@ -22,8 +22,9 @@ export class UsersController {
|
||||
|
||||
@Get()
|
||||
async findAll(@Query() query) {
|
||||
const { page, pageSize, searchNameTerm, searchEmailTerm } = Pagination.getPaginationData(query)
|
||||
const users = await this.usersService.getUsers(page, pageSize, searchNameTerm, searchEmailTerm)
|
||||
const { page, pageSize } = Pagination.getPaginationData(query)
|
||||
|
||||
const users = await this.usersService.getUsers(page, pageSize, query.name, query.email)
|
||||
if (!users) throw new NotFoundException('Users not found')
|
||||
return users
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user