@swell/apps-sdk 1.0.187 → 1.0.188

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.
package/dist/index.js CHANGED
@@ -4860,12 +4860,17 @@
4860
4860
  var SwellVariant = class extends SwellStorefrontRecord {
4861
4861
  product;
4862
4862
  constructor(swell, product, id, query) {
4863
+ const params = swell.queryParams;
4863
4864
  super(swell, "products:variants", id, query, async function() {
4864
4865
  const variant = await this._swell.get(
4865
- "/products:variants/{id}",
4866
- { id: this._id }
4866
+ "/products:variants/:last",
4867
+ { $or: [{ id: this._id }, { sku: this._id }] }
4868
+ );
4869
+ return transformSwellVariant(
4870
+ params,
4871
+ product instanceof SwellStorefrontRecord ? await product.resolve() : product,
4872
+ variant
4867
4873
  );
4868
- return variant ?? null;
4869
4874
  });
4870
4875
  this.product = product;
4871
4876
  }