@W-21252790: 1cc in Developer Preview mode #3662
@W-21252790: 1cc in Developer Preview mode #3662kumaravinashcommercecloud merged 8 commits intorelease-3.16.xfrom
Conversation
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
| if (res && res.status !== 200) { | ||
| const errorData = await res.json() | ||
| throw new Error(`${res.status} ${String(errorData.message)}`) | ||
| await throwIfResponseNotOk(res) |
There was a problem hiding this comment.
An alternative, without touching the commerce-sdk-react package, we could update the slas proxy override suggested by @clavery (on Slack) to be able to return JSON responses. I don't know if that is more closer to the actual SCAPI response, but I feel like it's worth a check?
|
lint is failing |
| // Keep continue button visible if email is valid (for unregistered users) | ||
| if (isValidEmail(email)) { | ||
| // 404 = email not registered (guest); treat as guest and continue | ||
| const isGuestNotFound = String(error?.message || '').includes('404') |
There was a problem hiding this comment.
non-blocking, this could be flaky to base on the error message instead of status code, but seems like it's working, we can improve it later.
There was a problem hiding this comment.
the sdk throws error like this: throw new Error(${res.status} ${message}) so here we are looking for 404 in the error, not the error message itself.
Description
Types of Changes
Changes
How to Test-Drive This PR
Checklists
General
Accessibility Compliance
You must check off all items in one of the follow two lists:
or...
Localization