Open Aung-Zaw-Phyo opened 1 month ago
If i don't add groupBy, result items are not correct. That's why I add groupBy. But when i add groupBy, relationship items are not correct. Example, there are many items in categories relationship but it return first item of relationship items.
async paginate(options: IPaginationOptions): Promise<Pagination<Product>> { const queryBuilder = this.repo.createQueryBuilder('c'); queryBuilder .leftJoinAndSelect('c.categories', 'categories') .leftJoinAndSelect('c.variants', 'variants') .leftJoinAndSelect('c.images', 'images') .groupBy('c.id') .orderBy('c.createdAt', 'DESC'); return paginate<Product>(queryBuilder, options); }
Please give me some good ideas
If i don't add groupBy, result items are not correct. That's why I add groupBy. But when i add groupBy, relationship items are not correct. Example, there are many items in categories relationship but it return first item of relationship items.
Please give me some good ideas