-
Notifications
You must be signed in to change notification settings - Fork 131
Open
Description
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
Metadata
Metadata
Assignees
Labels
No labels