nestjs-typeorm-paginate
nestjs-typeorm-paginate copied to clipboard
[bug] paginate not filter 🐞
Hello! I am using the example with TypeOrm and MySQL: @Injectable() export class CatService { builder( @InjectRepository(CatEntity) private readonly repository: Repository<CatEntity>, ) {}
async paginate(options: IPaginationOptions): Promise<Pagination<CatEntity>> { return paginate<CatEntity>(this.repository, options, { lives: 9, }); } }
and when reviewing the query log, the generated SQL does not apply WHERE in the query and as a result it lists all the paginated records but without applying the WHERE filter.
Meanwhile I am using createQueryBuilder.
Thanks.
Try
{where: {lives: 9}}