@infrab4a/connect-angular 4.0.0-beta.22 → 4.0.0-beta.24

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -134,6 +134,7 @@ class CouponService {
134
134
  filters: {
135
135
  coupon: { id: coupon.id },
136
136
  payment: { status: 'paid' },
137
+ ...(coupon.influencerEmail ? { user: { email: userEmail } } : {}),
137
138
  },
138
139
  });
139
140
  // orders que usuario ja fez com o cupom
@@ -481,7 +482,10 @@ class CartService {
481
482
  catch (error) {
482
483
  if (!(error instanceof NotFoundError))
483
484
  throw error;
484
- variant = await this.variantRepository.get({ id: productId });
485
+ const { data: variants } = await this.variantRepository.find({ filters: { id: productId } });
486
+ variant = variants.shift();
487
+ if (!variant)
488
+ throw error;
485
489
  product = await this.productRepository.get({ id: variant.productId });
486
490
  }
487
491
  return {