I have set up pagination using the library found at https://github.com/nestjsx/nestjs-typeorm-paginate.
However, I am encountering an error with the code snippet below:
return this.usersService.findAll({ page, limit });
Can anyone offer insight into what might be causing this issue? Thank you.
Below is my controller implementation:
@Roles('User')
async findAll(@Query('page') page = 0, @Query('limit') limit = 10): Promise<UserEntity> {
limit = limit > 100 ? 100 : limit;
return this.usersService.findAll({ page, limit });
}
And here is how the service is defined:
async findAll(options: IPaginationOptions): Promise<Pagination<UserEntity>> {
return await paginate<UserEntity>(this.usersRepository, options);
}