Skip to content

Fixed: logic for fetching orders when showShippingOrders is enabled#780

Closed
ymaheshwari1 wants to merge 1 commit into
hotwax:mainfrom
ymaheshwari1:fix/order-fetch-shipping-orders
Closed

Fixed: logic for fetching orders when showShippingOrders is enabled#780
ymaheshwari1 wants to merge 1 commit into
hotwax:mainfrom
ymaheshwari1:fix/order-fetch-shipping-orders

Conversation

@ymaheshwari1

Copy link
Copy Markdown
Contributor

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

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread src/store/order.ts
} as any;

if (useProductStore().isProductStoreSettingEnabled('SHOW_SHIPPING_ORDERS')) {
if (useProductStore().isProductStoreSettingEnabled('showShippingOrders')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
if (useProductStore().isProductStoreSettingEnabled('showShippingOrders')) {
if (useProductStore().isShowShippingOrdersEnabled) {

Comment thread src/store/order.ts
} as any

if (!useProductStore().isProductStoreSettingEnabled('SHOW_SHIPPING_ORDERS')) {
if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) {
if (!useProductStore().isShowShippingOrdersEnabled) {

Comment thread src/store/order.ts
} as any

if (!useProductStore().isProductStoreSettingEnabled('SHOW_SHIPPING_ORDERS')) {
if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

Suggested change
if (!useProductStore().isProductStoreSettingEnabled('showShippingOrders')) {
if (!useProductStore().isShowShippingOrdersEnabled) {

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant