@shopkit/data-layer 1.4.4 → 1.4.6
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/adapters/index.js +7 -4
- package/dist/adapters/index.js.map +1 -1
- package/dist/adapters/index.mjs +7 -4
- package/dist/adapters/index.mjs.map +1 -1
- package/dist/index.js +66 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +66 -6
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/adapters/index.mjs
CHANGED
|
@@ -3783,10 +3783,10 @@ var PRODUCT_ENDPOINTS = {
|
|
|
3783
3783
|
getProduct: (v = DEFAULT_VERSION) => `/api/${v}/product/details`,
|
|
3784
3784
|
getProductsByHandles: (v = DEFAULT_VERSION) => `/api/${v}/product/details`,
|
|
3785
3785
|
getCollections: (v = DEFAULT_VERSION) => `/api/${v}/collections`,
|
|
3786
|
-
getCollectionByHandle: (v = DEFAULT_VERSION, h) => `/api/${v}/collections/handle/${h}`,
|
|
3787
|
-
getCollectionById: (v = DEFAULT_VERSION, id) => `/api/${v}/collections/${id}`,
|
|
3786
|
+
getCollectionByHandle: (v = DEFAULT_VERSION, h) => `/api/${v}/collections/handle/${encodeURIComponent(h)}`,
|
|
3787
|
+
getCollectionById: (v = DEFAULT_VERSION, id) => `/api/${v}/collections/${encodeURIComponent(id)}`,
|
|
3788
3788
|
getCollectionsByHandles: (v = DEFAULT_VERSION) => `/api/${v}/collections/details`,
|
|
3789
|
-
getCollectionFilters: (v = DEFAULT_VERSION, collectionHandle) => `/api/${v}/storefront/collections/${collectionHandle}/filters`
|
|
3789
|
+
getCollectionFilters: (v = DEFAULT_VERSION, collectionHandle) => `/api/${v}/storefront/collections/${encodeURIComponent(collectionHandle)}/filters`
|
|
3790
3790
|
};
|
|
3791
3791
|
|
|
3792
3792
|
// src/adapters/custom/product/service.ts
|
|
@@ -4190,9 +4190,12 @@ var ProductService2 = class extends BaseCustomService {
|
|
|
4190
4190
|
}
|
|
4191
4191
|
const payload = {
|
|
4192
4192
|
storeId: this.config.storeId,
|
|
4193
|
-
available: params.filters?.[0]?.available ?? true,
|
|
4194
4193
|
collectionHandles: handles
|
|
4195
4194
|
};
|
|
4195
|
+
const availability = params.filters?.[0]?.available;
|
|
4196
|
+
if (typeof availability === "boolean") {
|
|
4197
|
+
payload.available = availability;
|
|
4198
|
+
}
|
|
4196
4199
|
if (params.filters && params.filters.length > 0) {
|
|
4197
4200
|
const filter = params.filters[0];
|
|
4198
4201
|
if (filter.price?.min !== void 0) {
|