them valkue
This commit is contained in:
@@ -961,9 +961,7 @@ class ProductService {
|
||||
async getProductDetails(productId: number) {
|
||||
await this.validateProduct(productId);
|
||||
const docs = await this.productRepo.getProductDetails(productId);
|
||||
if ((!docs?.[0]?.variants || docs?.[0]?.variants.length === 0) && docs?.[0]?.category.theme !== "noColor_noSize") {
|
||||
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());
|
||||
|
||||
Reference in New Issue
Block a user