@aptos-scp/scp-component-store-selling-features-domain-model 2.8.0 → 2.8.1

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.
@@ -62,15 +62,16 @@ exports.getItemFilterByValue = getItemFilterByValue;
62
62
  function getItemLookupKey(defaultLookupKey, omniChannelConfig, selectedStoreItem) {
63
63
  var _a, _b, _c;
64
64
  let itemLookupKey = defaultLookupKey;
65
- if (!defaultLookupKey) {
66
- if (omniChannelConfig && omniChannelConfig.inventory && omniChannelConfig.inventory.itemKeyType) {
67
- itemLookupKey = (_b = (_a = selectedStoreItem) === null || _a === void 0 ? void 0 : _a.itemLookupKeys) === null || _b === void 0 ? void 0 : _b.find((itemKey) => {
68
- return itemKey.type === omniChannelConfig.inventory.itemKeyType;
69
- });
65
+ if (omniChannelConfig && omniChannelConfig.inventory && omniChannelConfig.inventory.itemKeyType) {
66
+ const configuredItemKey = (_b = (_a = selectedStoreItem) === null || _a === void 0 ? void 0 : _a.itemLookupKeys) === null || _b === void 0 ? void 0 : _b.find((itemKey) => {
67
+ return itemKey.type === omniChannelConfig.inventory.itemKeyType;
68
+ });
69
+ if (configuredItemKey) {
70
+ itemLookupKey = configuredItemKey;
70
71
  }
71
72
  }
72
73
  if (!itemLookupKey) {
73
- return (_c = selectedStoreItem) === null || _c === void 0 ? void 0 : _c.itemLookupKeys[0];
74
+ return defaultLookupKey || ((_c = selectedStoreItem) === null || _c === void 0 ? void 0 : _c.itemLookupKeys[0]);
74
75
  }
75
76
  return itemLookupKey;
76
77
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aptos-scp/scp-component-store-selling-features-domain-model",
3
- "version": "2.8.0",
3
+ "version": "2.8.1",
4
4
  "description": "This component library provides the common components to handle the coordination of processing the business events from the UI.",
5
5
  "private": false,
6
6
  "license": "SEE LICENSE IN LICENSE.md",