SalesforceCommerceCloud / pwa-kit

React-based JavaScript frontend framework to create a progressive web app (PWA) storefront for Salesforce B2C Commerce.
https://developer.salesforce.com/docs/commerce/pwa-kit-managed-runtime/guide/pwa-kit-overview.html
BSD 3-Clause "New" or "Revised" License
276 stars 124 forks source link

@W-16161754 - [BUG 🐞] Fix `useCustomQuery` not using `throwOnBadResponse` argument #1879

Open bendvc opened 3 days ago

bendvc commented 3 days ago

Description

We recently added the useCustomQuery hook to the commerce-sdk-react library. But we forgot to ensure that we are passing the throwOnBadResponse=true argument. This meant that custom apis that were returning error status codes weren't throwing errors resulting in the hooks query status being a "success" when it should be an "error". This PR fixes this by passing this argument in.

Types of Changes

Changes

How to Test-Drive This PR

Checklists

General