Fixed: logic for fetching orders when showShippingOrders is enabled#780
Fixed: logic for fetching orders when showShippingOrders is enabled#780ymaheshwari1 wants to merge 1 commit into
Conversation
There was a problem hiding this comment.
Code Review
This pull request updates the key used to check the product store setting for showing shipping orders from 'SHOW_SHIPPING_ORDERS' to 'showShippingOrders' in src/store/order.ts. The reviewer suggested utilizing the existing isShowShippingOrdersEnabled getter from the product store instead of querying with a hardcoded string key, which would improve type safety and maintainability.
| } as any; | ||
|
|
||
| if (useProductStore().isProductStoreSettingEnabled('SHOW_SHIPPING_ORDERS')) { | ||
| if (useProductStore().isProductStoreSettingEnabled('showShippingOrders')) { |
There was a problem hiding this comment.
Instead of querying the setting with a hardcoded string key, you can use the existing isShowShippingOrdersEnabled getter defined in the productStore. This improves type safety and maintainability.
| if (useProductStore().isProductStoreSettingEnabled('showShippingOrders')) { | |
| if (useProductStore().isShowShippingOrdersEnabled) { |
| } as any | ||
|
|
||
| if (!useProductStore().isProductStoreSettingEnabled('SHOW_SHIPPING_ORDERS')) { | ||
| if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) { |
There was a problem hiding this comment.
Instead of querying the setting with a hardcoded string key, you can use the existing isShowShippingOrdersEnabled getter defined in the productStore. This improves type safety and maintainability.
| if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) { | |
| if (!useProductStore().isShowShippingOrdersEnabled) { |
| } as any | ||
|
|
||
| if (!useProductStore().isProductStoreSettingEnabled('SHOW_SHIPPING_ORDERS')) { | ||
| if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) { |
There was a problem hiding this comment.
Instead of querying the setting with a hardcoded string key, you can use the existing isShowShippingOrdersEnabled getter defined in the productStore. This improves type safety and maintainability.
| if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) { | |
| if (!useProductStore().isShowShippingOrdersEnabled) { |
Related Issues
Short Description and Why It's Useful
Screenshots of Visual Changes before/after (If There Are Any)
Contribution and Currently Important Rules Acceptance