add : product stats

This commit is contained in:
morteza-mortezai
2025-11-01 13:14:38 +03:30
parent 47ec12169d
commit 024f3cb3a2
2 changed files with 28 additions and 1 deletions
@@ -979,8 +979,9 @@ class ProductService {
throw new BadRequestError(CommonMessage.NotEnoughVariant);
}
const product = ProductDTO.transformProduct(docs[0]);
const stats = await this.commentRepo.getProductStats(productId);
const categoryPath = await this.categoryRepo.getCategoryPath(product.category._id.toString());
return { product, categoryPath };
return { product, categoryPath, stats };
}
//**************************************************************