@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.mjs CHANGED
@@ -4833,12 +4833,17 @@ function transformSwellVariant(params, product, variant) {
4833
4833
  var SwellVariant = class extends SwellStorefrontRecord {
4834
4834
  product;
4835
4835
  constructor(swell, product, id, query) {
4836
+ const params = swell.queryParams;
4836
4837
  super(swell, "products:variants", id, query, async function() {
4837
4838
  const variant = await this._swell.get(
4838
- "/products:variants/{id}",
4839
- { id: this._id }
4839
+ "/products:variants/:last",
4840
+ { $or: [{ id: this._id }, { sku: this._id }] }
4841
+ );
4842
+ return transformSwellVariant(
4843
+ params,
4844
+ product instanceof SwellStorefrontRecord ? await product.resolve() : product,
4845
+ variant
4840
4846
  );
4841
- return variant ?? null;
4842
4847
  });
4843
4848
  this.product = product;
4844
4849
  }