product vriants bug
This commit is contained in:
@@ -20,11 +20,7 @@ class CartRepository extends BaseRepository<ICart> {
|
||||
})
|
||||
.populate({
|
||||
path: "items.variant",
|
||||
populate: [
|
||||
{ path: "warranty" },
|
||||
{ path: "shop" },
|
||||
{ path: "themeValue" },
|
||||
],
|
||||
populate: [{ path: "warranty" }, { path: "shop" }, { path: "themeValue" }],
|
||||
});
|
||||
}
|
||||
|
||||
@@ -235,13 +231,9 @@ class CartRepository extends BaseRepository<ICart> {
|
||||
{ $lookup: { from: "productvariants", localField: "items.variant", foreignField: "_id", as: "variantDetails" } },
|
||||
{ $unwind: "$variantDetails" },
|
||||
{ $lookup: { from: "warranties", localField: "variantDetails.warranty", foreignField: "_id", as: "variantDetails.warranty" } },
|
||||
{ $lookup: { from: "colors", localField: "variantDetails.color", foreignField: "_id", as: "variantDetails.color" } },
|
||||
{ $lookup: { from: "sizes", localField: "variantDetails.size", foreignField: "_id", as: "variantDetails.size" } },
|
||||
{ $lookup: { from: "meterages", localField: "variantDetails.meterage", foreignField: "_id", as: "variantDetails.meterage" } },
|
||||
{ $lookup: { from: "themeValues", localField: "variantDetails.themeValue", foreignField: "_id", as: "variantDetails.themeValue" } },
|
||||
{ $unwind: { path: "$variantDetails.warranty", preserveNullAndEmptyArrays: true } },
|
||||
{ $unwind: { path: "$variantDetails.color", preserveNullAndEmptyArrays: true } },
|
||||
{ $unwind: { path: "$variantDetails.size", preserveNullAndEmptyArrays: true } },
|
||||
{ $unwind: { path: "$variantDetails.meterage", preserveNullAndEmptyArrays: true } },
|
||||
{ $unwind: { path: "$variantDetails.themeValue", preserveNullAndEmptyArrays: true } },
|
||||
{ $lookup: { from: "shops", localField: "variantDetails.shop", foreignField: "_id", as: "variantDetails.shop" } },
|
||||
{ $unwind: "$variantDetails.shop" },
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user